OnePunchMickey
Programmer
I've got code along these lines:
<snip>
function DoImport()
Dim oCompanyRS As ADODB.Recordset
Set oCompanyRS = GetCompanyList("c:\folder\system")
end function
Function GetCompanyList(FullSystemPath As String) As ADODB.Recordset
cConnectString = "Provider=VFPOLEDB.1;Data Source=" + FullSystemPath + "\system.dbc;" & _
"Mode=ReadWrite|Share Deny None;Password='';Collating Sequence=MACHINE"
Set oConn = CreateObject("ADODB.Connection")
oConn.ConnectionString = cConnectString
oConn.Open
Dim oRS As ADODB.Recordset
Set oRS = New ADODB.Recordset
oRS.Open "SELECT field1 AS Code, field2 AS Name FROM SEQCO", oConn, adOpenStatic
GetCompanyList = oRS
End Function
</snip>
When this is run/compiled I get:
"Invalid use of object" on the GetCompanyList = oRS line.
Help!
***************************************
Need help running those old FoxPro apps on modern systems?
<snip>
function DoImport()
Dim oCompanyRS As ADODB.Recordset
Set oCompanyRS = GetCompanyList("c:\folder\system")
end function
Function GetCompanyList(FullSystemPath As String) As ADODB.Recordset
cConnectString = "Provider=VFPOLEDB.1;Data Source=" + FullSystemPath + "\system.dbc;" & _
"Mode=ReadWrite|Share Deny None;Password='';Collating Sequence=MACHINE"
Set oConn = CreateObject("ADODB.Connection")
oConn.ConnectionString = cConnectString
oConn.Open
Dim oRS As ADODB.Recordset
Set oRS = New ADODB.Recordset
oRS.Open "SELECT field1 AS Code, field2 AS Name FROM SEQCO", oConn, adOpenStatic
GetCompanyList = oRS
End Function
</snip>
When this is run/compiled I get:
"Invalid use of object" on the GetCompanyList = oRS line.
Help!
***************************************
Need help running those old FoxPro apps on modern systems?