VB script for connection to DB

N

nath

Hi,

I have managed to cobble together a forn in outlook that
sends the contents of the text boxes on that form to an
access DB. However, i used VBA to do this from the
outlook send button. I dont want to do this in the final
version i want a button on the form that does it, however
it has to be done in VB script. Can anyone help with the
translation

this is the vba code that i used.

Set wrkjet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbs = wrkjet.OpenDatabase(fname, True)

sql = "INSERT INTO tbl_vacancies ( Date_Notified,
[Location Name], "
sql = sql & "[Bus_Stream], [Job Title], [Hours],
[Num_of_posts] ) "
sql = sql & "SELECT #" & Date & "# AS Expr1,""" &
frm_values(3) & """ AS Expr2, """
sql = sql & frm_values(5) & """ AS Expr3, """ & frm_values
(1) & """ AS Expr4,"""
sql = sql & frm_values(2) & """ AS Expr5, """ & frm_values
(4) & """ AS Expr7;"

dbs.Execute sql
dbs.Close

TIA

Nathan.
 
H

Hollis D. Paul

I have managed to cobble together a forn in outlook that
sends the contents of the text boxes on that form to an
access DB. However, i used VBA to do this from the
outlook send button. I dont want to do this in the final
version i want a button on the form that does it, however
it has to be done in VB script. Can anyone help with the
translation
Go to www.outlookcode.com and look for an example. There should also
be examples on www.slipstick.com.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2600
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top