By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Vb-to Access Data With A Particular Unique Id/no

P: 81
Dear all,

I am having a .mdb database, in which following fields are there:-
USER ID :-
FORM NO :-
NAME:-
ADDRESS :-
CITY :-
ZIP :-
CONTACT NO :-

I WANTED TO CREATE A SOFTWARE IN VB, Where i can search name address and city thru USER id or form no.
Requesting you to kindly guide me how to write code for this.

Regards
Anup
May 3 '07 #1
Share this Question
Share on Google+
2 Replies


P: 81
hi,

Plz help me...I am in urgent need of this thing..
May 4 '07 #2

P: 47
Dear all,

I am having a .mdb database, in which following fields are there:-
USER ID :-
FORM NO :-
NAME:-
ADDRESS :-
CITY :-
ZIP :-
CONTACT NO :-

I WANTED TO CREATE A SOFTWARE IN VB, Where i can search name address and city thru USER id or form no.
Requesting you to kindly guide me how to write code for this.

Regards
Anup
hi,
here is the sample code to demonstrate how to retrieve data from table
I assume that that UserId or FormNo both are Unique Key.
Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim rsTemp As New ADODB.Recordset
  3.  Dim conTemp As New ADODB.Connection
  4.  
  5.  If rsTemp.State = adStateOpen Then rsTemp.Close
  6.  rsTemp.Open "Select * from [TABLE NAME] where formNo=' " & txtformNo.Text  &  " ' ", conTemp, adOpenDynamic, adLockOptimistic
  7.  If rsTemp.RecordCount > 0 Then
  8.     txtName.text=rsTemp.fields("Name").values
  9.     txtAddress.text=rsTemp.fields("ADDRESS").values
  10.     txtCITY.text=rsTemp.fields("CITY").values
  11.  Else
  12.   ' message display record Not found
  13.   End If
  14.  
May 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.