|
-
Sep 18th, 2000, 05:40 PM
#1
Thread Starter
New Member
I got a PROBLEM about ADO ...
Let's put this scenario:
I got the following Tables:
o Clients
o Orders
o Details
o Credit
o Payments
Also I got a form with SSTAB with all the text boxes Required to bind info or make data entry.
So ... Every time when the user open his application, He gonna get all the clients Assing to him.
The problem is about how to update, add information but to the different tables ... So I'm confused about how I can get this done.
Any recomendation is Welcome
Thanx
U Little Piece of Code!!!!
-
Sep 19th, 2000, 03:57 PM
#2
Frenzied Member
Make a data control, to bind, for every table you need to get/put data to (if you're using bound controls) _or_ retrieve the data from each table and populate the unbound fields...
-
Sep 19th, 2000, 05:59 PM
#3
Thread Starter
New Member
Ok ... Thanks for the recommendation, anyway do u have a little example to get clear the idea?
The other thing I forgot to mention is, I'm using SQL server 7, Stored procedures will help in this case?
Gracias 
[Edited by Kristo on 09-19-2000 at 07:01 PM]
U Little Piece of Code!!!!
-
Sep 27th, 2000, 03:30 PM
#4
Fanatic Member
If you have info in some variables, which we call strSomething:
Code:
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase("mydb.mdb") ' open database
Set rs = db.OpenRecordset("Clients") ' open table
With rs
'*** Add a record...
.Add
!FirstName = strFirstName ' set FirstName field in table
!LastName = strLastName
!PhoneNo = strPhoneNo
strID = !ID ' << get ID from new record (counter field)
.Update ' << store the data
End With
rs.Close
Set rs = db.OpenRecordset("Orders")
With rs
'*** Add record to order...
.Add
!OrderDate = Now() ' order date
!CustomerKey = strID ' Foreign key to Clients table
'
' more stuff here
'
strID = !ID ' get order ID if you need it
.Update
End With
rs.Close ' close table and DB...
db.Close
Set rs = Nothing ' not really needed I think, but still...
Set db = Nothing
This is an example using DAO ... ADO is probably pretty much the same.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|