Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error Opening ADO Recordset
Message
From
23/11/2002 10:32:56
Alhad Marathe
Asm Consulting
Mumbai, India
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00725619
Message ID:
00726144
Views:
22
Thanks for the suggestion. I simply removed the ON ERROR code and let the program report each error. That way I found out where the error was.

I also removed .CURSORTYPE = adOpenDynamic

Alhad

>Have you tried entering each line through the command window to isolate where it failed? Or write a standard error handler to tell you which line is breaking:
>
ON ERROR DO ErrorTrap WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
>
>PROCEDURE ErrorTrap (merror, mess, mess1, mprog, mlineno) &&----------
>on error
>if messagebox('Error number           :'+LTRIM(STR(merror))+chr(13);
>              +'Error message          :'+ mess+chr(13);
>              +'Line of code with error:'+mess1+chr(13);
>              +'Line number of error   :'+LTRIM(STR(mlineno))+chr(13);
>              +'Alias                  :'+alias()+chr(13);
>              +'Order()                :'+Order()+chr(13);
>              +'Program with error     :'+mprog,1+48,[Error Trapped!])=2
>   cancel
>else
>   ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
>endif
>endproc
>
>>I am trying to upload data from VFP tables into SQL server using ADO
>>
>>I can open the connection, but opening the recordset gives an error.
>>
>>My code is something like this.
>>
>>**
>>local ERR
>>on Error ERR = .T.
>>With oNewphotoRS
>> .ActiveConnection = oConnection
>> .Source = "Photographers"
>> .CursorLocation = adUseClient
>> .LockType = adLockBatchOptimistic
>> .CursorType = adOpenDynamic
>> .CommandType = adcmdTable
>> .Open()
>>EndWith
>>**
>>IF Err
>> WAIT WINDOW "Error opening recordset"
>>ENDIF
>>**
>>
>>What I am doing wrong here. I am using VFP 7.
>>
>>TIA
>>
>>Alhad
Only direct experience is Knowledge;
Everything else is just Information.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform