Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access on a server

Status
Not open for further replies.

mathprof

Programmer
Nov 8, 2000
37
US
My standalone VB6/access 2000 program works fine. Not so, when I put the app on a server. When a client calls the app it works fine. However, if a second client calls the app, it freezes. What must I work on when changing a standalone version to a client/server version?
Specifically,
#1 Should I put the entire app and db on the server or just the db?
#2 How does a connect string look if it's calling a database ON A SERVER?
Thanks,
Prof Martin Weissman
 
Hi,

You could be dealing with any number of things depending on how you are connecting to the db on the server. You could be running into security permission problems to connection timeout problems. Generally a Client/Server type application places the db on the server and the UI on the client. If you can provide a few more details on how you connect to the db ADO, DAO, ODBC, as well as how the network security is set up I may be able to help you. [spin] If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 

Hi foada:

Please view (below) my connect code to the db. The network admin put all files in a math911 folder on ther server and so the db was in this folder too. (My code CREATES the db the 1st time the app is run in the default path). The connection worked at a client but failed when the second client called the db.

#1 I'm going to put the app on each client and the db on the server.
#2 How should I modify the connection?
#3 Should I close the db after each access?
#4 I don't know what security is on the network, but how should I advise the network admin about security?

Is there any other info that you need?

I really appreciate your time.

Prof Weissman





Dim rs As New ADODB.Recordset
Set cnn = CreateObject("ADODB.Connection")
strCNN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db911.mdb"
cnn.Open strCNN
rs.ActiveConnection = cnn
rs.LockType = adLockReadOnly
rs.CursorLocation = adUseClient
TABLENAME$ = "Classes"
SQLstmt = "SELECT * from " & TABLENAME$ & " where number = " & Val(classCODE)
rs.Open SQLstmt
TABLENAME$ = rs!ClassName
rs.Close

Really appreciative,

Prof Martin Weissman
 
Just where does it "freeze"?
You need to identify if it is actually the connection, or the rest of the code.

First of all, add the ConnectionComplete event to your project, and put a message box there to inform you if the connection was successful or not.

Set the ConnectionTimeOut parameter to something like 30 seconds. Use the errrors collection in the Disconnect event to identify any errors.

See if, when the first client is connected, ACCESS can open the MDB also. Or have just two clients both using ACCESS, open the MDB to see if there are no problems there.

Make sure the MDB is not being opened exclusively.

An MDB is just a file, and a server will handle it as such. Some older server versions have had problems with this (Novell), (though more so with records updates being reflected on other connections).

Lastly, what happens when you use a server side cursor? (adUseClient) [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top