Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO in OfficeVBA to VFP DBC with Stored Procs
Message
 
To
24/07/2000 15:58:29
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00396293
Message ID:
00396340
Views:
9
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>
Sorry, I was not sure to post this in the VFP forum or the Office forum, but here it is...

I am using Microsoft Excel VBA and ADO to connect to a VFP6 dbc with stored procedures to calculate the primary keys.

Everything works fine until I try to create a new record through ADO with the recordset.addnew command. I get an error message that says the provider can not do that command.

Does anyone know of a workaround without going to a COM solution? I am not up on the COM learning curve, and would hate to postpone this project until that can happen.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Dan -- the problem could be that you are not using one of the updateable recordset types in ADO. Try a client-side, static sets and see if that works (see some ADO documentation for info on the exact constant references in VBA).

If you are still stuck, you can use the SQL Insert command through an ADO Command object.... something like->

objCommand.CommandText = 'Insert into TheTable (lastname, firstname) values("Neuman", "Dan")'
objCommand.Execute()

The problem here is that you won't be able to do batch updates this way -- in other words, you won't be able to load up the record set, make any other necessary calculations, and then update the batch. This is a one-record-at-a-time approach. But, having said that, for this purpose, it's generally quicker than using AddNew anyway.

Hope this helps, or at least buys you some time.
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform