Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ADO / SQL / MS Outlook E-Form

Posted on 2000-03-23
3
Medium Priority
?
193 Views
Last Modified: 2013-12-25
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
Comment
Question by:Chrynoble
  • 2
3 Comments
 
LVL 9

Expert Comment

by:samopal
ID: 2650923
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
 
LVL 9

Accepted Solution

by:
samopal earned 300 total points
ID: 2650925
Sorry...

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

0
 
LVL 1

Author Comment

by:Chrynoble
ID: 2661097
I can't test this right now, but it looks like you have solved a catch 22 for me.

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question