ADO / SQL / MS Outlook E-Form

Posted on 2000-03-23
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?
Question by:Chrynoble
  • 2

Expert Comment

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


Accepted Solution

samopal earned 75 total points
ID: 2650925

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


Author Comment

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


Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal reports - Formula Field code need assistance with code 17 60
using web browser with BING 40 119
How to Add / Edit Windows Menu 4 59
Passing a Text Box name to a Sub 6 96
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now