Solved

connect sql using vb

Posted on 2006-06-30
1
246 Views
Last Modified: 2013-11-23
how can i connect ms sql by vb using ADODB. Please help
0
Comment
Question by:ajaypappan
1 Comment
 
LVL 11

Accepted Solution

by:
leclairm earned 125 total points
ID: 17018090
dim oConn as adodb.connection
dim rs as adodb.recordset
set oConn = new adodb.connection
set rs = new adodb.recordset
oconn.open "Provider=sqloledb;Data Source=dbServer;Initial Catalog=YourDb;User Id=YourUser;Password=YourPassword;"
rs.open "select * from yourtable", oConn

if not rs.eof and not rs.bof then
   do some processing...
end if


Don't forget to set your reference to the ado library.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now