I'm converting a program from VB6 to VB 2005 and am having problems trying to figure out the connection and updating the database. In VB6 my code looked pretty much like this:
Most of my research results have turned up information geared towards SQL or I just don't seem to understand what they are getting at.
I know this is a simple soluton and I would appreciate a little help in the right direction.
Thanks
Code:
Set objCon = New ADODB.Connection
Set objCom = New ADODB.Command
'Creating the DB connection string
objCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=WorkOrders.mdb;Persist Security Info=False"
'Opening the connection
objCon.Open objCon.ConnectionString
Set objRSPendingWorkOrders = New ADODB.Recordset
objRSPendingWorkOrders.Open "tblPendingWorkOrders", objCon, adOpenStatic, adLockOptimistic
With objRSPendingWorkOrders
.AddNew
.Fields("Environment") = dtacmbEnvironment.BoundColumn
.Fields("ServerType") = dtacmbServerType.Text
.Fields("RequestorName") = txtRequestorName
.Fields("ContactNo") = txtContactNo
.Fields("ProjectNo") = txtProjectNo
.Fields("ProjectName") = txtProjectName
.Fields("WorkGroup") = cboWorkGroup
.Fields("SWFDate") = txtSWFDate
.Fields("InstallIssuances") = txtInstallIssuances
.Fields("BackoutIssuances") = txtBackoutIssuances
.Fields("NoonRequest") = optNoon.Value
.Fields("ContactAlias") = txtRequestorAlias
.Fields("CCAlias1") = txtCCAlias1
.Fields("CCAlias2") = txtCCAlias2
.Fields("CCAlias3") = txtCCAlias3
.Fields("CCAlias4") = txtCCAlias4
.Fields("CCAlias5") = txtCCAlias5
.Fields("Servers") = sServers
.Update
End With
Most of my research results have turned up information geared towards SQL or I just don't seem to understand what they are getting at.
I know this is a simple soluton and I would appreciate a little help in the right direction.
Thanks