PC Review


Reply
Thread Tools Rate Thread

How to access another table

 
 
mac
Guest
Posts: n/a
 
      11th Jun 2004
My database is in SQL2K and frontend is in VFP.

I have standard software and this software allows users to use VBAe to do
the modifications.

Here is a scenerio, user enters a part number in a text box. I need to take
that part number and search it in a able ABC. If found then display,
Description, Quantity on hand, Price, etc. etc......

How do I open a table and read the record ?

Thanks


 
Reply With Quote
 
 
 
 
Tim Ferguson
Guest
Posts: n/a
 
      11th Jun 2004
"mac" <(E-Mail Removed)> wrote in
news:r_nyc.8728$(E-Mail Removed):

>
> How do I open a table and read the record ?
>
>



' you only want one record
strSQL = "SELECT * FROM abc WHERE PartNumber = " & dwGetPartNumber

' open it read only
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot, dbForwardOnly)

If rs.EOF Then
' oh dear, it wasn't there
MsgBox "Some Useful Error Message Here", etc

Else
' okay, get the values: use a With block for speed and ease of
' typing if you like
dwSerialNumber = rs!Serial
strDescription = rs!Description
dtLastUpDated = rs!LastUpdate
' etc

End If

rs.Close


Hope that helps. This is the DAO version; the ADO is similar but opens the
recordset on a connection object rather than a database, and the parameters
are a bit different.

B Wishes


Tim F




 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting data from linked db2 table using access make table quer =?Utf-8?B?R2lueWN1YjIy?= Microsoft Access External Data 0 29th Aug 2006 07:31 PM
Table properties from SQL table not propagated to Access table =?Utf-8?B?UGV0ZXI=?= Microsoft Access Database Table Design 0 8th Feb 2006 06:37 PM
Importing Excel into Access table creates blank rows to table? =?Utf-8?B?ZWZhYWgw?= Microsoft Access External Data 1 11th Jan 2006 03:57 PM
Exporting Access table/view to XML and importing XML file into a Access table Karen Middleton Microsoft Access External Data 0 4th Oct 2004 12:36 PM
How do I stop Access from asking confirmation to delete a table in a Make-Table Query? Mike Webb Microsoft Access Queries 4 8th Mar 2004 08:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:06 PM.