Я скомпилировал свою программу Visual Basic 6.0, она работает на компьютере, на котором я ее сделал, но при перемещении на другой компьютер я получаю ошибку времени выполнения 91. Расположение или база данных хорошие, поэтому не уверен, что случилось
Private Sub cmdSave_Click()
Dim Count As Integer
Dim iReturn As String
Dim Client As New ADODB.Recordset
Dim sSQL As String
Set Client = CreateObject("ADODB.Recordset")
If Newrec = "New" Then
Client.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Shipping Bible\Client Code.mdb"
sSQL = "SELECT * FROM Client"
Client.Open sSQL, , adOpenStatic, adLockOptimistic, adExecuteNoRecords And adCmdText
txtSearch = txtClient
With Client
.AddNew
.Fields("Code") = txtClient
.Fields("Roll Type") = txtRoll
.Fields("Package Type") = txtPack
.Fields("Bag Size") = txtBag
.Fields("Label") = txtLabel
.Fields("Arrow") = txtArrow
.Fields("Carrier 1") = txtCarrier1(0)
.Fields("Carrier 2") = txtCarrier1(1)
.Fields("Carrier 3") = txtCarrier1(2)
.Fields("Account 1") = txtAccount(0)
.Fields("Account 2") = txtAccount(1)
.Fields("Account 3") = txtAccount(2)
.Fields("Additional Notes") = txtNote
.Fields("Invoice") = Val(txtInvoice)
.Fields("Certificate of Origin") = Val(txtCOO)
.Fields("Performa Invoice") = Val(txtPerforma)
.Fields("Special Stickers") = chkSticker
.Fields("Invoice Not In Box") = chkInvoice
.Fields("Certificates Scanned") = chkScanned
.Fields("Packed Seperatly") = chkSeperate
.Fields("Need Authorization To Ship") = chkAuthorization
.Fields("Label Box With Sticker") = chkBoxLabel
.Fields("Check For Payment") = chkPayment
.Update
End With
iReturn = MsgBox("New Record added", vbOKOnly)
Else
With adoClient.Recordset
.Update
TotalRecords = .RecordCount
If adoClient.Recordset.Bookmark = TotalRecords Then
.MoveLast
Else
.Move 0
End If
End With
End If
End Sub
Private Sub Form_Activate()
With adoClient.Recordset
.MoveLast
TotalRecords = .RecordCount
.MoveFirst
End With
txtSearch.SetFocus
cmdLeft.Enabled = False
Looking = "No"
LSearch = "No"
RSearch = "No"
End Sub
Private Sub Form_Load()
Dim Count As Integer
Dim Client As New ADODB.Recordset
Dim sSQL As String
Set Client = CreateObject("ADODB.Recordset")
Client.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Shipping Bible\Client Code.mdb"
sSQL = "SELECT * FROM Client"
Client.Open sSQL, , adOpenStatic, adLockOptimistic, adExecuteNoRecords And adCmdText
end sub