Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Type Compatibility
Message
From
23/05/2001 12:43:58
 
 
To
23/05/2001 11:42:32
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00510404
Message ID:
00510458
Views:
15
>I am having a very difficult time using the adodb.parameters collection in that I can't seem to properly define or map many different VB data types to the SQL Server stored procedure data types they are passed to (ie. adDate doesn't match properly to DateTime, and adGUID doesn't seem to match properly to UNIQUEIDENTIFIER.) Is there a good reference somewhere out there for this kind of information?
>
>Thanks.

By using the Refresh method you can find out what data types you should specify in your parameters. I know it sounds a little silly but you would do this once during coding and every time your sp parameters change. Or, you could do it in every call to the sp but you would take a performance hit with the extra trips to the server.

It would be something like this:
Cmd.Parameters.Refresh
For Each oPrm In Cmd.Parameters
  Debug.Print oPrm.Name, oPrm.Type
Next
Although with this you will get the integer values of the type and you will have to find out the corresponding constant in the ADO help.

If you know some VFP, I have a little utility in the files section of the VFP forum called "Get ADO parameters collection" that you can download and point to your SQL Server to get details about any sp with input/output parameters.
Previous
Reply
Map
View

Click here to load this message in the networking platform