Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odbc ado
Message
From
27/10/2004 13:19:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/10/2004 10:44:52
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00954876
Message ID:
00954929
Views:
13
>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 ?

Your ODBC string doesn't have Trusted_connection=no but ADO one does. Are you sure your SQL server installation is set to mixed mode authentication? Probably it's set to windows authentication mode only.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform