vb with odbc

J

jonathandrott

I'm new to using two databases at the same time with my vb program. I
have a db named InvoiceProcessing that has two fields UPC and ItemDesc.
UPC is populated, but ItemDesc needs to be filled from db2 (ILSA)
(with fields PLU_NUM and PLU_DESC) i need to fill ItemDesc with the
info in PLU_DESC based on the comparison of UPC and PLU_NUM. I don't
even know where to start. Thanks.
 
R

rowe_newsgroups

Check out the System.Data.ODBC namespace and also lookup the keywords
"dataset" and "dataadapter"

Thanks,

Seth Rowe
 
J

jonathandrott

I actually know how to connect to the databases through odbc. I need
help with the sql syntax. sorry for being vague :)
 
R

rowe_newsgroups

Just to clarify: Do you have one database with two tables
(InvoiceProcessing and ILSA)? If so what type of database are you using
(SQL Server, Access, Oracle, etc...)?

Thanks,

Seth Rowe
 
J

jonathandrott

two seperate db's and they are both access
rowe_newsgroups said:
Just to clarify: Do you have one database with two tables
(InvoiceProcessing and ILSA)? If so what type of database are you using
(SQL Server, Access, Oracle, etc...)?

Thanks,

Seth Rowe
 
R

rowe_newsgroups

Since you don't seem to comfortable with SQL, I'll teach you a little
trick. Open up one of the access databases and add a linked table that
points to the other table in the other database. Then build your query
in "design view" making sure you set the query type to update. After
you get what you want then switch to SQL view and voila - you have your
SQL string. Basically, if I read your post right your sql should be
something like:

<pseudocode>

UPDATE InvoiceProcessing
SET ItemDesc = PLU_DESC
WHERE UPC = PLU_NUM
AND UPC = 'Your Condition'

</pseudocode>

Just a warning - I wrote that really quick so be careful. Also you
might want to use the OleDb namespace instead of Odbc for Access
connections.

Thanks,

Seth Rowe
 
S

Steve Long

Access is so sweet for that. It will usually, at least, get you started in
the right direction.
 

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