Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What port does VFP use for SQL Connection
Message
 
To
11/06/2019 17:01:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01669000
Message ID:
01669021
Views:
89
This message has been marked as the solution to the initial question of the thread.
>>>Ok then, let me ask this - what's the difference between VS (c#) and VFP in making the connection to an SQL backend? I'm trying to use the same userid/password that our website uses to connect to the same server, different DB.
>>>I can, however, connect to the server with this userid/password and run querys against the DB I'm trying to connect to; but when I try to use these credentials via VFP I get 'Login denied'
>>
>>I don't know how do you connect What do you use in C# and what in VFP?
>>SqlConnection() in C# and SQLSTRINGCONNECT() in VFP?
>>Caould you please post the connection strin from C# (remove all sensitive data in it)
>
>c#
>connectionString ="data source=204.67.nn.nnn; initial catalog=DataWarehouseDB; user id=#########;password=#########;Trusted_Connection=False;"
TEXT TO lcConnection NOSHOW PRETEXT 15
          Driver={SQL Server};Database=DataWarehouseDB;Server=204.67.nn.nnn;UID=USERID;PWD=PASSOWRD;
ENDTEXT
lnHandler = SQLSTRINGCONNECT(lcConnection)
IF lnHandler < 0
   AERROR(aaa)
   MessageBox(aaa[1,2])
ELSE
   MessageBox("Connection is successful")
ENDIF
SQLDISCONNECT(0)
Just change IP address to the real one and of course SQL user and SQL Password
If this didn't work try to force protocol to be TCP/IP or Named Pipes
Just add to connection string:
;Network=dbnmpntw - for Named pipes
Network=dbmssocn; - for TCP/IP
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform