Hi experts out there,

I have a program where the backend is access database. I was able to run the program in user's pc after i placed it at C drive. After that, i placed it in the server and created shortcut to the.exe, the program ran. But, when i clicked the save button to store the data, it showed this error:
Runtime error '-2147467259 (80004005)'
Operation must use an updateable query.
Please anyone help me with this problem. I need it urgently. Thank you in advance.

Your problem is that you created a shortcut to the .exe and not the database which was not at the path specified. If you are changing to a server, you will need a different connection string and make sure the database resides in the path specified.

Your app can not read from your database because it does not reside in the path specified.

Hi,
This is my connection string:

Sub ConnectDB()
    Dim strDB As String
    Dim varYN As Variant
    varYN = MsgBox("Use Test Environment", vbYesNo)
    If varYN = vbNo Then
    strDB = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.path & "\LSICBLKIT.mdb;Persist Security Info=False"
    Else
    strDB = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.path & "\TEST_LSICBLKIT.mdb;Persist Security Info=False"
    End If
    
    Set DB = New ADODB.Connection
    DB.CursorLocation = adUseClient
    DB.Open strDB
End Sub

How do i change the connection string to point to the database in server? Pls help.

You will need to make use of the IP Address. Try the following -

strDB = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\192.168.0.199\MySerberCDriveName\LSICBLKIT.MDB;Persist Security Info=False"
 '192.168.0.199 = your Ip Address on which the database will be running.

Did this help?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.