Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add two databases for connection between sql and foxpro

Status
Not open for further replies.

Niki_S

Programmer
Jun 4, 2021
232
LK
This is my code and I need to add MIS and MAS as my databases. How can I do that?
Code:
Public hndOps
strPipe="DRIVER={SQL Server};SERVER=sglsql;UID=starnet;PWD=*star321#;DATABASE=MIS"
hndOps=Sqlstringconnect(strPipe)
SQLSetprop(hndOps,"dispwarnings",.T.)

Thank you
 
When databases are in the same server instance, simply connect to one of them, ie stay with MIS. If your SQL user has privileges to work on both databases they will be available addressing them with their FQN, ie using MIS.tablename and MAS.tablename. So you can work on multiple databases with the same connection, the specification of one of them just makes it the default, so ou can address MIS tables without the MIS prefix, but you can also access MAS tables. There's no problem unless you've got insufficient granted rights.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top