Inputing Into SQL DB from Visual 2003 App
Posted on 2006-06-20
I'm a VB 6.0 programmer that is used to using commands such as the ones shown below. I'm trying to take baby steps so all I want to do now is create a simple form and enter the information into a single table within a SQL DB located on my laptop. Are there any easy tutorials or examples I can cheat off of to learn how to do this?
Const provider As String = "Provider=SQLOLEDB;Data Source=servername;Initial Catalog=tablename;Integrated Security=SSPI;"
Public cn As ADODB.Connection
Dim variablename As New ADODB.Recordset
Public Sub opendatabase()
On Error GoTo error
Set cn = New ADODB.Connection
cn.ConnectionString = provider
Dim errloop, errcol
Set errcol = cn.Errors
For Each errloop In errcol
MsgBox errloop.Description & vbCrLf