Access foxpro database with VB 6.0. I get error message when I get to this code: Set rs = cmd.Execute
The error message is:
The connection cannot be used to perform this operation. It is Either closed or invalid in this context.
This is the code to connect:
Dim cn As New ADODB.Connection
cn.Open "Provider=vfpoledb.1;" & _
"Data Source =D:\PerCap1\percap2.dbf;"
cn.Close
Set cn = CreateObject("ADODB.Connection"
cn.ConnectionString = "Provider=vfpoledb.1;Data Source =D:\PerCap1\percap2.dbf"
cn.Open
The error message is:
The connection cannot be used to perform this operation. It is Either closed or invalid in this context.
This is the code to connect:
Dim cn As New ADODB.Connection
cn.Open "Provider=vfpoledb.1;" & _
"Data Source =D:\PerCap1\percap2.dbf;"
cn.Close
Set cn = CreateObject("ADODB.Connection"
cn.ConnectionString = "Provider=vfpoledb.1;Data Source =D:\PerCap1\percap2.dbf"
cn.Open