Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

ADO / SQL / MS Outlook E-Form

I am creating a form in outlook.
It stores the emailed data in a access data base.
The following code (Outlooks VB Script) gives me the error "Syntax error in FROM clause."

Set objRec = CreateObject "ADODB.Recordset")

Source = "SELECT * FROM OEMService WHERE ID = " & RecordNumber & " ORDER BY ID"

ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\OEMdb.mdb"

objRec.Open Source, ConnStr, 2, 2, 2

Why is this error occuring &
How do I fix this?
0
Chrynoble
Asked:
Chrynoble
  • 2
1 Solution
 
samopalCommented:
The first thing you need to do is to create Connection

Set objCon = CreateObject "ADODB.Connection"
Set objRec = CreateObject "ADODB.Recordset"

Source = "SELECT * FROM OEMService WHERE ID = " & RecordNumber & " ORDER BY ID"

ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\OEMdb.mdb"

objCon.Open ConnStr
objRec.Open Source, ObjCon, 2, 2, 2


HTH
0
 
samopalCommented:
Sorry...

Set objCon = CreateObject("ADODB.Connection")
Set objRec = CreateObject("ADODB.Recordset")

0
 
ChrynobleAuthor Commented:
I can't test this right now, but it looks like you have solved a catch 22 for me.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now