i have develop a system by using my pc, then i need to install this system in the server.But i face problem when i put in the server. In the beginning, the function that i done can not work, after i add in the EYEDOG.OCX file, it can work already. But now i face another problem.
i had use a invisible textbox to do the connection.This is the code below:
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
Dim intresponse As Integer
If Me.optCheckNew = True Then
intresponse = MsgBox("are you sure you want to save this record?", vbOKCancel)
If intresponse = vbOK Then
Set objConn = Application.CurrentProject.Connection
Set objRecSrc = CreateObject("ADODB.Recordset")
objRecSrc.Open "tblLotCreated", objConn _
, adOpenStatic _
, adLockOptimistic _
, adCmdTable
If objRecSrc.Supports(adAddNew) Then
objRecSrc.AddNew
objRecSrc!DateCreated = Me.fakeDateCreated
objRecSrc!ProductNo = Me.fakeProductNo
objRecSrc!LotID = Me.fakeLotID
objRecSrc!QtyCreated = Me.fakeQtyCreated
objRecSrc!Shift = Me.fakeShift
objRecSrc.Update
Me.frmLotCreated1_List.Requery
Me.Requery
End If
Exit Sub
End If
Else
Me.optCheckNew = False
MsgBox ("Please click new before insert a new record")
End If
Me.cmdNew.SetFocus
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
i think this code is no problem because it can work in my pc. But when i open in the server in another pc, it show this error:
Method 'connection' of object' _currentproject' failed.
what i can do?
thanks for help.
i had use a invisible textbox to do the connection.This is the code below:
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
Dim intresponse As Integer
If Me.optCheckNew = True Then
intresponse = MsgBox("are you sure you want to save this record?", vbOKCancel)
If intresponse = vbOK Then
Set objConn = Application.CurrentProject.Connection
Set objRecSrc = CreateObject("ADODB.Recordset")
objRecSrc.Open "tblLotCreated", objConn _
, adOpenStatic _
, adLockOptimistic _
, adCmdTable
If objRecSrc.Supports(adAddNew) Then
objRecSrc.AddNew
objRecSrc!DateCreated = Me.fakeDateCreated
objRecSrc!ProductNo = Me.fakeProductNo
objRecSrc!LotID = Me.fakeLotID
objRecSrc!QtyCreated = Me.fakeQtyCreated
objRecSrc!Shift = Me.fakeShift
objRecSrc.Update
Me.frmLotCreated1_List.Requery
Me.Requery
End If
Exit Sub
End If
Else
Me.optCheckNew = False
MsgBox ("Please click new before insert a new record")
End If
Me.cmdNew.SetFocus
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
i think this code is no problem because it can work in my pc. But when i open in the server in another pc, it show this error:
Method 'connection' of object' _currentproject' failed.
what i can do?
thanks for help.