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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access to SQL

Status
Not open for further replies.

JohnStep

Programmer
Apr 19, 2000
190
US
I have a question for those SQL guys. I do editing and saving in Access using the DAO 3.5 all the time. I have reviewed some code and seeing that altering SQL seems to be nearly the same. Is this true? Or how would you best edit SQL databases through VB with DAO or??
 
Hey, I personally prefer ADO (ODBC) connections... but that is just my preference.

Kevin

- "The truth hurts, maybe not as much as jumping on a bicycle with no seat, but it hurts.
 
And I would tend to go without a DSN and use OLEDB....

Code:
Dim ConnectionString As String
Dim con As ADODB.Connection

ConnectionString = "Provider=SQLOLEDB;Data Source=ServerName;User ID=UserID;Password=Password;Initial Catalog=Database;"

Set con = New ADODB.Connection

con.Open ConnectionString

'...

con.Close
Set con = Nothing

You need a reference to Microsoft ActiveX Data Object 2.x instead of the one to DAO.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top