Mitch Swetsky
asked on
DSN Less connection in VBS to and Access database. Error in Set Conn...
In the code below I get an error at Set conn1
Either server is undefined or object expected.
What am I doing wrong?
OPTION EXPLICIT
DIM Conn1, rs1, cst, strSQL1, myMail, body
' OPEN a OLE DB CONNECTION
Set conn1 = server.CreateObject("ADODB .Connectio n")
cst = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=C:\Users\Administra tor\Deskto p\Schedule dDBs\OUTRI DsXpert.ac cdb;"
conn1.open cst
'Create a Record Set with the Conn from above, then Set SQL, and then execute
Set rs1 = Server.CreateObject("ADODB .Recordset ")
strSQL1 = "select * from Qry_CountRIDS-ByRSE"
rs1.Open strSQL1, conn1,3,3
Either server is undefined or object expected.
What am I doing wrong?
OPTION EXPLICIT
DIM Conn1, rs1, cst, strSQL1, myMail, body
' OPEN a OLE DB CONNECTION
Set conn1 = server.CreateObject("ADODB
cst = "Provider=Microsoft.Jet.OL
conn1.open cst
'Create a Record Set with the Conn from above, then Set SQL, and then execute
Set rs1 = Server.CreateObject("ADODB
strSQL1 = "select * from Qry_CountRIDS-ByRSE"
rs1.Open strSQL1, conn1,3,3
ASKER
Yes I am trying to use a vbs to read from the access db and mail a note with a table.
I changed to that but get a "provider can't be found" 800A0E7A
I changed to that but get a "provider can't be found" 800A0E7A
I remember that driving me nuts when I was working on Access files - Common wisdom is to make sure you're on the latest version of your programs, drivers, etc, but at some point Microsoft stopped shipping JET with their MDAC drivers. So you need extra files that aren't installed with the latest version.
There's a good article here that may help get it installed.
There's a good article here that may help get it installed.
ASKER
Thank you for your patience.
It seems that accdb uses a new oledb string.
http://www.connectionstrings.com/access/
I tried the sample here but am still unable to get it to pass that line.
Tomorrow is a new day and I'll try then.
It seems that accdb uses a new oledb string.
http://www.connectionstrings.com/access/
I tried the sample here but am still unable to get it to pass that line.
Tomorrow is a new day and I'll try then.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am working on a production Server and would like to avoid reinstalling Access.
You and I know of all the permissions and stuff can get broken
You and I know of all the permissions and stuff can get broken
Yes, but for the code to work you need a driver installed. Maybe you can build a "service" server that can run tasks like this.
ASKER
Thanks again Rob And Ed,
I believe I understand now. Sometimes I get so caught up I forget to look.
I will try and find another way to install the new drivers, or attempt to re-install Access after making a server copy during off work hours.
I really do appreciate your patience and the chance to learn.
I believe I understand now. Sometimes I get so caught up I forget to look.
I will try and find another way to install the new drivers, or attempt to re-install Access after making a server copy during off work hours.
I really do appreciate your patience and the chance to learn.
Sure. Just keep in mind it's not the full Access product. It's just a database engine driver to facilitate data connections for requirements like this. If you're running virtual machines, take a snapshot before installing it, just in case anything goes wrong, but it shouldn't be a problem.
ASKER
Oh I didn't realize that!
Sort of like MDAC
Thank you for the clarification, I will feel much more confident!
It is a VM and that was my intent with a server copy.
Sort of like MDAC
Thank you for the clarification, I will feel much more confident!
It is a VM and that was my intent with a server copy.
Open in new window
as shown here.