PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming VB script for connection to DB

Reply

VB script for connection to DB

 
Thread Tools Rate Thread
Old 01-09-2004, 04:57 PM   #1
nath
Guest
 
Posts: n/a
Default VB script for connection to DB


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.
  Reply With Quote
Old 02-09-2004, 06:12 PM   #2
Hollis D. Paul
Guest
 
Posts: n/a
Default Re: VB script for connection to DB

In article <433e01c4903c$61dc6dd0$a601280a@phx.gbl>, Nath wrote:
> 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]
Hollis@outhousebythesound.com
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2600
http://search.support.microsoft.com...D=TECH&LN=EN-US

Mukilteo, WA USA


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off