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!

SQL Connection

Status
Not open for further replies.

rstum2005

Programmer
Jun 9, 2005
117
0
0
US
Connecting to SQL Server 2000.

Any tips on how to do this?
 
I use ADO. Which version of Builder are you using?


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Good. Is it the personal, Professional, or Developer version? Do you have the dbGo or ADO components? I know these come standard in the Developer version but I don't know about the Pro version.



James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
I dont quite remember. Im not at my desktop but I know for sure it as ado components. Whenever I try to connect to a database it asks for username and password and it does not accept the windows un&pass. Im quite lost, thanks for you help.
 
You will need to set up the ADO connection string for your ADO component(s). I can also show you how to set up a connection through Windows ADO API. It's an undocumented call. When you are ready, let me know. It's not hard once you understand it.

James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Ok thanks. Ill read into it and get back with you with some more questions.

Ron
 
It is very easy, just copy and paste this


ServerName is an AnsiString (loaded externaly), leave it like that, because that way you can change the serverName
without changing the code
Code:
Connection->ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=YourDataBaseName;Data Source=" + ServerName;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top