Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC error and AERROR()
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00052673
Message ID:
00052814
Views:
40
>Sorry about that hit the wrong key
>
>
>STORE SQLCONNECT('DSNNAME','','') TO gnConnHandle
>IF gnConnHandle <= 0
> = MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
>ELSE
> = MESSAGEBOX('Connection made', 48, 'SQL Connect Message')
> ck=SQLEXEC(gnConnHandle,mysqlstatement,"myquery")
> if ck=-1
> = AERROR(aErrorArray) && Data from most recent error
> ? 'The error provided the following information' && Display message
> FOR n = 1 TO 7 && Display all elements of the array
> ? aErrorArray(n)
> ENDFOR
> else
> process data
> endif
>ENDIF
>=SQLDISCONNECT(gnConnHandle)
>
>Of course you can put the error returned in a message box but this works for us.
>could it be because you have already defined the laerror size

Boy is my face red! All I needed was the "=" before AERROR(laerror). Defining laerror before doesn't matter. The array is re-dimensioned with the AERROR() function.

Thanks for your help. Sometimes I just miss the obvious!
Previous
Reply
Map
View

Click here to load this message in the networking platform