how to connect an outlook2000 form to an oracle db

G

Guest

hello,
i set up a MS data link (*.udl), connected to the db succesfully, then tried
to use the corresponding connection string to connect a custom outlook form
to an oracle db.
so far, no luck.

here is the code

ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;User
ID=FMS_USER;Data Source=eben"

cnn.Open ConnectionString
strSQL = "SELECT tournumber FROM FMS_TOUR"
rs.Open strSQL, cnn, 3, 3

Do While Not rs.EOF

objItem.GetInspector.ModifiedFormPages("Message").ComboBox1.AddItem
(rs.Fields("tournumber"))
rs.MoveNext
Loop
rs.Close

can anybody help me. what am i doing wrong?
thanks
Stefan
 
S

Sue Mosher [MVP-Outlook]

Error messages? This is code running inside an Outlook form? If so, then there are two problems with this expression:

objItem.GetInspector.ModifiedFormPages("Message").ComboBox1

It should be:

Item.GetInspector.ModifiedFormPages("Message").Controls("ComboBox1")

Also you can use List instead of AddItem; see http://www.outlookcode.com/d/formcontrols.htm#listcombo

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

this is what i tried now:

***************
Set LB1 = Item.GetInspector.ModifiedFormPages("message").Controls("ListBox1")
LB1.Clear

With rs
..MoveLast
..MoveFirst
LB1.Column() = .GetRows(.RecordCount)

End With

rs.Close
************

still no luck
unfortunately, no error messages

connecting to an access db works fine
 
S

Sue Mosher [MVP-Outlook]

Unfortunately, I have no Oracle DB to test against, but if you're using the OLE DB provider for Oracle (http://msdn.microsoft.com/library/en-us/ado270/htm/mdreforacleprovspec.asp), wouldn't it be MSDAORA instead of MSDASQL, e.g.:

strConnect = "Provider=MSDAORA;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;"

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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