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!

Using SQL in Visual Basic

Status
Not open for further replies.

xburgler

Programmer
Apr 6, 2001
12
0
0
DE
I use Visual Basic 6 and MS Access to develop my applications. I heard that SQL is quicker them MS Access so I want to change.

What do I need to use SQL and where can I find examples of it.

Tanks
Jorge
 
You might want to try and use ADO to ocnnect to a sql server.
Dim rs AS NEW ADODB.Recordset. You will also need to have a connectstring,
connect="DataSource=ServerName;Provider=sqloledb.1;Password=user;User ID=user;Initial Catalog=databasename".
Once you have your ado object declared and the connect string established you will exec a sql statement like this,
rs.open "sql statement here", connect
 
And you will also have to make quite a few chnages to your queries etc as they need to conform to SQL Server standards, not Access. For example, no Format's in query strings. Peter Meachem
peter@accuflight.com
 
In addition, you may want to start converting all of your queries into stored procedures as they run faster than executing your queries in your code. Check out SQL Server online book for example of writing stored procedures.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top