My app no longer updates the DB after I changed the location of the connections. I used to contain all the connection code in the updateBMO procedure. After i moved to the cmdStartBMOLoad sub, the app no longer updates.
What have I done wrong?
Private Sub cmdStartBMOLoad_Click()
Dim dbs As ADODB.Recordset
Dim dbs2 As ADODB.Recordset
Dim i As Integer
'open the oracle and access connections
'access
Set mcnn = New ADODB.Connection
mcnn.ConnectionString = "Provider=MSDASQL.1;" & _
"Data Source=MSRP13;Password=mellon;User ID=dc_dba;"
mcnn.Open
Set dbs = New ADODB.Recordset
dbs.CursorType = adOpenKeyset
dbs.LockType = adLockOptimistic
dbs.Source = sql
Public Sub updateBMO()
'Dim conn As New ADODB.Connection
'Dim rs As New ADODB.Recordset
Dim sql As String
sql = " insert into BMOList values(" & strId & ", '"
sql = sql & FName & "', '" & LName & "', '" & addr1 & "', '"
sql = sql & addr2 & "', '" & addr3 & "', '" & addr4 & "','" & city
sql = sql & "', '" & state & "','" & country & "', #" & DOB & "#, '" & var & "', '" & var4d & "')"
Set dbs.ActiveConnection = mcnn
dbs.Open sql, mcnn
End Sub
TIA Bastien
There are many ways to skin this cat,
but it still tastes like chicken