vb with odbc

  • Thread starter Thread starter jonathandrott
  • Start date Start date
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.
 
Check out the System.Data.ODBC namespace and also lookup the keywords
"dataset" and "dataadapter"

Thanks,

Seth Rowe
 
I actually know how to connect to the databases through odbc. I need
help with the sql syntax. sorry for being vague :)
 
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
 
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
 
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
 
Access is so sweet for that. It will usually, at least, get you started in
the right direction.
 
Back
Top