Here's the situation guys, I make a program that only in one computer the data will be saved. what I mean is I put this program in two or three computers then one must be the "server"? Can you guide me how to do this... here's my code to connect in SQL SERVER.

Public adoconn as ADODB.Connection

Sub main()
   Set adoconn = New ADODB.Connection
   adoconn.ConnectionString = "DSN=My Sample; DESC=My SQL Server; SERVER=localhost; DATABASE=chatdbase; OPTION=3; PORT=3306;UID=;PASSSWORD=;STMT=;"
         adoconn.Open
End Sub

Please configure my code if it is right.

Hope you get what I mean...thanks!

Hi Jireh,

Change in ur connection string :

SERVER=ServerName

Check ConnectionStrings.com
for format of conn string
LocalHost means , it will run only in Server

REgards
Veena

or you can use server IP.

You can use these Connection Strings for SQL 2000:

ODBC with Standard Security
Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

ODBC with Trusted connection
Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Trusted_Connection=Yes;

OLEDB .NET with Standard Security
Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

OLEDB with Trusted connection
Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

SqlConnection (.NET) with Standard Security
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
OR
Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;

SqlConnection (.NET) with Trusted connection
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

You can use any of the Driver based on your requirement.

using SQL Server Native Driver is the fastest. Then comes OLEDB and then ODBC.

You can even write a generic data access class to make it Driver independent.

You can use any of the Driver based on your requirement.

using SQL Server Native Driver is the fastest. Then comes OLEDB and then ODBC.

You can even write a generic data access class to make it Driver independent.

Can you please show me some samples on how to do it, please?

What sample do you want? The link in vbsqluser post has some samples. Let me know if you need more elanorate one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.