MS SERVER 2003
MS SQL 2000
WINDOW XP
VFP 8.0
Hi everyone
[ODBC] I can connect my MS-SQL and read file as below coding:-
*****
LOCAL NHANDLE AS NUMBER, CSTRING AS CHARACTER
CSTRING="DRIVER=SQL SERVER;SERVER=FILE1;UID=Administrator;PWD=888;DATABASE=TEST1"
NHANDLE=SQLSTRINGCONNECT(CSTRING)
=SQLEXEC(NHANDLE,"SELECT * FROM TEST2","CURRS")
*****
========== QUESTION 1
[ADO] BUT IT CAN NOT CONNECT WHEN CODING AS BELOW :-
*****
LOCAL OCONN AS ADODB.CONNECTION
OCONN=CREATEOBJECT("ADODB.CONNECTION")
OCONN.OPEN("PROVIDER=SQLOLEDB.1;DATA SOURCE=FILE1;INITIAL CATALOG=TEST1;UID=Administrator;PWD=888;TRUSTED_CONNECTION=NO")
ORECORDSET.MOVEFIRST()
RELEASE ORECORDSET
*****
>>>> Error message :
OLE IDispatch exception code 0 from MS OLE DB Provider for SQL Server: Login failed for use "Administrator": Reason: Not associated with a trusted SQL Server connection...
=========== QUESTION 2
I through VPN to login Server and sun my system ( use SQLSTRINGCONNECT() to open SQL-file)
i need to wait for over 40 sec. to open the first file, is't something wrong on my coding ?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only