|
-
Nov 8th, 2002, 02:19 AM
#1
Thread Starter
Junior Member
How?
Saving records in VB 6.0
1. Run Microsoft Visual Basic 6.0.
2. In New Tab, select Standard EXE.
3. In Project Explorer, right-click the Form1 and Click Add/More Active Designers/Data Environment. (DataEnvironment1 appear and a Connection)
4. Right-click the Connection and select Properties.
5. In Provider Tab, Select Microsoft Jet 4.0 OLE DB Provider
6. In Connection Tab, browse the database location. (C:\My Documents\Records.mdb)
7. In Advanced Tab, check ReadWrite
8. Right-click the Connection again and select Add Command. (Command1 appear)
9. Right-click the Command1 and select Properties.
10. In General Tab, under the SQL Statement, type: “SELECT * FROM Table1” (no quotation)
11. In Advanced Tab, choose the 4-Batch Optimistic Lock Type and click OK.
12. Back to Form. Add 3 TextBoxes; Text1, Text2 and Text3. Add Label to each TextBox. Employee No to Text1, Employee Name to Text2 and Position to Text3. Add also a Command Button (Command1)
13. On load event of the Form add this code: DataEnvironment1.rsCommand1.Open
14. On the click event of the Command1, add the following code:
With DataEnvironment1.rsCommand1
.AddNew
.Fields(0).Value = Text1.Text
.Fields(1).Value = Text2.Text
.Fields(2).Value = Text3.Text
.UpdateBatch
End With
15. You can now add records.
================================
How will I do that in VB.NET?
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
|