jerome_gail26
10-11-2009, 08:00 PM
Hi,
VB6.0
MSACCESS (.mdb)
On first run i can save, edit. delete etc. in the application with no problem and both client/server are updated. But sometimes i got error UNSEPECIFIED ERROR message. And when i remove and highlights the connection.
Here are some code that I suspect the reason for the said error.
'MODULE
Public dbConnectMDB As New ADODB.Connection
Function ConnectNow()
Set dbConnectMDB = New Connection
dbConnectMDB.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & "Z:\MyDatabase.mdb"
End Sub
'FORM
Dim rs_Record as New ADODB.Recordset
Private Sub Command1_Click()
Call ConnectNow
Set rs_Record = New Recordset
rs_Record.Open "UPDATE Receive_Delivery SET Landed_Cost = '" & txt_Price.Text & "' " & _
" Where SKU_Number = '" & txt_Sku.Text & "'", db_rDel, adOpenDynamic, adLockOptimistic
Set Datagrid1.Datasource = rs_Record
End Sub
Hope you can help me here.
Thanks in advance,
Jerome And Gail
VB6.0
MSACCESS (.mdb)
On first run i can save, edit. delete etc. in the application with no problem and both client/server are updated. But sometimes i got error UNSEPECIFIED ERROR message. And when i remove and highlights the connection.
Here are some code that I suspect the reason for the said error.
'MODULE
Public dbConnectMDB As New ADODB.Connection
Function ConnectNow()
Set dbConnectMDB = New Connection
dbConnectMDB.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & "Z:\MyDatabase.mdb"
End Sub
'FORM
Dim rs_Record as New ADODB.Recordset
Private Sub Command1_Click()
Call ConnectNow
Set rs_Record = New Recordset
rs_Record.Open "UPDATE Receive_Delivery SET Landed_Cost = '" & txt_Price.Text & "' " & _
" Where SKU_Number = '" & txt_Sku.Text & "'", db_rDel, adOpenDynamic, adLockOptimistic
Set Datagrid1.Datasource = rs_Record
End Sub
Hope you can help me here.
Thanks in advance,
Jerome And Gail