tags:

views:

46

answers:

2

Using VB6 and SQL Server 2005

I want to write a sql connection for connecting to other system sql server.

Code

ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=STAR;Data Source=" & SName & ""

In SName - Am giving a Server Name

The Above connection code is working for the same system, Suppose I want to connect to other system database means

For example

I run the program in system A, the Database in system B. How to write a sql connection

Is possible with IP Address like SName = 192.12.12.1/System B

How to Write a connection string.

Need Code Help.

A: 

I'm not sure I entirely understand the question but can you not just have another separate connection string referencing the second server?

Simon
+1  A: 

It depends on your network / DNS, you should be able to enter the machine name, you may also need a domain name.

SQL Server also has something called Named Pipes for accessing a SQL instance by it's name - do a google search on that...

rohancragg