Showing posts with label thru. Show all posts
Showing posts with label thru. Show all posts

Monday, March 12, 2012

Open connection

How can I tell if I left a connection open? I'm calling slq thru ASP pages.
Thanks,
SueOriginally posted by belewe92614
How can I tell if I left a connection open? I'm calling slq thru ASP pages.
Thanks,
Sue

Use the profiler and run a trace on connections. There are trace options to track when a connection opens and closes.|||You can use the sp_who procedure to see what processes are connected in the server: "EXEC sp_who"|||I you are using ADO to connect through an ASP you can check your status

adStateClosed 0 The object is closed
adStateOpen 1 The object is open
adStateConnecting 2 The object is connecting
adStateExecuting 4 The object is executing a command
adStateFetching 8 The rows of the object are being retrieved

See more from this link State Property (http://www.w3schools.com/ado/prop_state.asp)

Open an Password Protected Access-2000 Database (OLE DB)

Hi,
I have created reports for a password protected database using Crystal Reports-8 thru OLE DB Connection. Whenever calling the report from a VB Form(thru Crystal Report Active-x Control), it reports "Unable to logon to SQL Server".

But if I try same thru ODBC Connection thru a DSN, it works perfect.

Since, there is a need to change the name of the source database (during runtime, the report has to access data from different databases), I require the same thru an OLE DB Connection. OR there is any way to change the database name in an odbc dsn by modifying connection parameters?

I remain.

Thanks.If u r tring to open Access database which has password. to change the database at runtime u can use the following code in vb.My report using Direct Database file connection not oledb or others.

Report.Database.Tables.Item(1).Location = App.Path & "\" & dbName
Report.Database.Tables(1).SetSessionInfo "", Chr(10) & txtPass

if u have more then on table u can use loop.