User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,488 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,733 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 3935 | Replies: 7
Reply
Join Date: Jul 2007
Location: Philippines
Posts: 253
Reputation: jireh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 28
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz in Training

Troubleshooting How to connect in sql "server"?

  #1  
Sep 19th, 2007
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!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 743
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 100
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: How to connect in sql "server"?

  #2  
Sep 21st, 2007
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
Reply With Quote  
Join Date: Aug 2006
Location: Egypt
Posts: 763
Reputation: RamyMahrous is on a distinguished road 
Rep Power: 4
Solved Threads: 59
Featured Poster
RamyMahrous's Avatar
RamyMahrous RamyMahrous is offline Offline
Master Poster

Re: How to connect in sql "server"?

  #3  
Sep 21st, 2007
or you can use server IP.
B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 613
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 15
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Solution Re: How to connect in sql "server"?

  #4  
Oct 2nd, 2007
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;
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 613
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 15
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

News Re: How to connect in sql "server"?

  #5  
Oct 2nd, 2007
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.
Reply With Quote  
Join Date: Aug 2007
Posts: 11
Reputation: vbsqluser is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
vbsqluser vbsqluser is offline Offline
Newbie Poster

Re: How to connect in sql "server"?

  #6  
Oct 4th, 2007
Reply With Quote  
Join Date: Jul 2007
Location: Philippines
Posts: 253
Reputation: jireh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 28
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz in Training

Re: How to connect in sql "server"?

  #7  
Oct 23rd, 2007
Originally Posted by binoj_daniel View Post
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?
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 613
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 15
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: How to connect in sql "server"?

  #8  
Oct 23rd, 2007
What sample do you want? The link in vbsqluser post has some samples. Let me know if you need more elanorate one.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 3:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC