home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form PlatVB_5_28_1
- Caption = "Visual Basic ADO Demonstration 1"
- ClientHeight = 1215
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4725
- LinkTopic = "Form1"
- ScaleHeight = 1215
- ScaleWidth = 4725
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command3
- Caption = "Next"
- Height = 375
- Left = 2400
- TabIndex = 3
- Top = 720
- Width = 2175
- End
- Begin VB.CommandButton Command1
- Caption = "First"
- Height = 375
- Left = 120
- TabIndex = 2
- Top = 720
- Width = 2175
- End
- Begin VB.TextBox Text2
- Height = 435
- Left = 2400
- TabIndex = 1
- Text = "Text2"
- Top = 120
- Width = 2175
- End
- Begin VB.TextBox Text1
- Height = 435
- Left = 120
- TabIndex = 0
- Text = "Text1"
- Top = 120
- Width = 2175
- End
- Attribute VB_Name = "PlatVB_5_28_1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim RS As Recordset
- Public Sub Command1_Click()
- RS.MoveFirst
- Text1.Text = RS.Fields(1)
- Text2.Text = RS.Fields(2)
- End Sub
- Private Sub Command3_Click()
- RS.MoveNext
- Text1.Text = RS.Fields(1)
- Text2.Text = RS.Fields(2)
- End Sub
- Public Sub Form_Load()
- Dim conn As ADODB.Connection
- Set conn = CreateObject("ADODB.Connection")
- conn.Open "DSN=PlatVB5;SERVER=SoftCoyote;UID=sa;PWD=wlfhwlfh"
- Set RS = conn.Execute("SELECT * FROM MyTable")
- Text1.Text = RS.Fields(1)
- Text2.Text = RS.Fields(2)
- End Sub
-