slow connection problem with Mssql 2000 server?

webturk
04-20-2004, 02:19 AM
hello,
i try to connect Sql 2000 server with this code. But i is very slowly.
What is wrong in this code or which code must i use getting fast connection?

Best Regards

conn_str = "Driver={SQL Server};Server=" & ServerIP & ";Uid=us; Pwd=pass;Database=db"
db.ConnectionTimeout = 0
db.CommandTimeout = 50
db.Open conn_str

wengwashere
04-20-2004, 02:29 AM
How long does it take to connect to SQL Server if your using a client tool (Query Analyzer), is it that long? or much faster?

webturk
04-20-2004, 02:36 AM
Hello,
it takes only 3 seconds with query analyzer.


How long does it take to connect to SQL Server if your using a client tool (Query Analyzer), is it that long? or much faster?

wengwashere
04-20-2004, 02:46 AM
try using this:

Provider=SQLOLEDB;Data Source=SERVERIP;User ID=us;Password=pass;Connect Timeout=10;Initial Catalog=db

but im not sure it would be of greater help. Is the DB in a network or in ur own workstation?

webturk
04-20-2004, 02:50 AM
yes mdb is in a network.
is it problem?
but i must use this program with an another computer in my network.

best regards

wengwashere
04-20-2004, 03:02 AM
"probably" that is one reason why it is slow, but we are still not sure yet. would you post your code below if you dont mind.

try tracing the code and look on what part it executes the slowest

MKoslof
04-20-2004, 07:09 AM
Three seconds over a network is not unreasonable. If you said half a minute, or over 15 seconds, I would be concerned. Depending on the network traffic, the speed of your login will vary.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum