Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending data from Unicode text file
Message
From
04/04/2003 19:12:37
Larry Huisingh
Lockheed Martin Information Technology
Richland, Washington, United States
 
 
To
03/04/2003 12:13:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00772500
Message ID:
00774352
Views:
16
>>Thank you for the great response! The detailed sample was very informative. It turns out that the "Trusted_Connection" clause was keeping me from connecting successfully since I had a user account and password I was trying to use at the same time. I took out that "Trusted_Connection" clause and my code worked like a charm. I didn't realize it was that easy. I will be able to avoid processing an externally generated UNICODE text file entirely! I can just put the data in a cursor and work with it that way.
>>
>>Now I will need to look into how to handle possible connection errors. Everything works as planned if there are no errors and fortunately I haven't had any network or server problems. Any particular sneaky errors I need to look for?
>
>Might be many :) To start check return value of SQLExec (I didn't in code).
>Looks like :
>
>
>if SQLExec(lnHandle, ....) < 0 && Error
> CheckError()
>*...
>
>function CheckError
>local ix, lcMsg
>local array arrErr[1]
>aerror(arrErr)
>set textmerge to memvar lcMsg noshow
>set textmerge on
>for ix =1 to 6 && aError returns 7 elems -we need first 6 at most for ODBC
>  \<<arrErr[ix]>>
>endfor
>set textmerge to
>set textmerge off
>messagebox(lcMsg)
>
>VFP might also give an error before aError content. aError would give more detailed info about what happened and an SQLserver error number as well.
>Cetin

Thanks. Now, is the "to memvar lcMsg" clause of the set textmerge statement a VFP 7 or 8 specific clause? I don't see it in the help for VFP 6.
Larry Huisingh
Lockheed Martin Information Technology
Richland WA USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform