#1) How can I get the following code to run under vbs? It already works under vba, but under vbscript I get the error message
provider cannot be found. It may not be properly installed
#2) How can I get it to use DAO instead of ADO? (this is not too important, but I would like to know for future projects.)
The code must run on Windows 7 computers with Office 2010 home and business, They do NOT have MS Access installed.
Const path = "C:\Users\bob.berke\Documents\db1.mdb"
const custno = 1234567
sql = "select folder from table2 where cust = " & custno
Set objconnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objconnection.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & path
objRecordSet.Open sql, objconnection
--- some background details, but they are not very important --------
I have modified the windows explorer context menu for our small business client computers.
When users right click on a file named "Client #1234 has not received their order" the users see the normal windows commands like "open", "delete" and one additional command :
"GOTO client's master folder"
When the user chooses that GOTO option, the vbs program grabs the filename, scans for the client number, then opens the directory associated with the order.
Right now, the client numbers are hard coded in the vbs, but that is a temporary workaround until I figure out how to get the data from the database.