Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO & VFP
Message
 
 
To
04/03/1999 10:18:14
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00194021
Message ID:
00194092
Views:
30
When you say it fails, what OLE-DB Error message do you get?

The following is a revised version of your code:

oConnection = CreateObject("ADODB.Connection")
oCommand = CreateObject("ADODB.Command")
With oConnection
.CursorLocation = 3 && Client-Side Cursor
.ConnectionString = "DATABASE=PROGLIB;DSN=DDHELP;UID=someone;PWD=;"
.Open
EndWith
With oCommand
.CommandText = "Select * from programs where rtrim(ltrim(progrm_key)) = ?"
oparameter = .CreateParameter("v_progkey",129,1,1,"1")
.Parameters.Append(oParameter)
.CommandType = 1
.ActiveConnection = oConnection
oRecordSet = .Execute
EndWith

?oRecordset.Fields.Count

For Each Field in oRecordset.Fields
?Field.Name,Field.Value
Next Field

For starters, if you are using SQL Server, I would HIGHLY recommend using the OLE-DB Provider, NOT the OLE-DB Provider for ODBC.

Things to verify:

1. The number of fields in the Recordset
2. The names of the fields in the Recordset


Good luck,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform