Open an access db from vbscript (1 Viewer)

Rob.Mills

Registered User.
Local time
Today, 04:19
Joined
Aug 29, 2002
Messages
871
I know this can be done but can someone refresh my memory on how to do this?
 

david.brent

Registered User.
Local time
Today, 08:19
Joined
Aug 25, 2004
Messages
57
Just to make sure do you just need to establish a connection or extract some data?

I normally do something like this.

sqlString = Some SQL
conn_String="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(Database name)

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open conn_String

Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.Open SQLString, objConn


Take care.
 

Rob.Mills

Registered User.
Local time
Today, 04:19
Joined
Aug 29, 2002
Messages
871
I guess I didn't explain completely. What I want it to is open the database so the user can use it just as if the user had double-clicked on the file icon.

I think you have to use wscript or something to that effect.
 

david.brent

Registered User.
Local time
Today, 08:19
Joined
Aug 25, 2004
Messages
57
I think I've used somthing like this in the past but I'm not sure.

Set accDB = CreateObject("Access.Application")
accDB.OpenCurrentDatabase("Database Name")
accDB.DoCmd.OpenModule "Module2","CreateSpreadsheets"
accDB.CloseCurrentDatabase
accDB.Quit
This runs a sub called CreateSpreadsheets in Module2.

But I'm still not sure this is what you need.

If you are using vbscript or html in a web page could you just hyperlink to it?

<a href=.Database>Database Name</a> 'HTML

response.write("<a href=.Database>Database Name</a>") 'Script

Hope this helps.
 

Users who are viewing this thread

Top Bottom