Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bounding TextControl to fields.
Message
De
26/03/2001 15:07:18
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Bounding TextControl to fields.
Divers
Thread ID:
00488669
Message ID:
00488669
Vues:
29
Hello,

I'm testing a form that displays first_name and last_name from a SQL70 table called OptOut ( database is also called OptOut ).
Below is the code to establish the connection and recordset(Hope is Ok).
How should I set the following textbox control properties ? :
text1.datafield
text1.datamember
text1.datasource
-------------------------------------------------------------


Dim cnMyConnection As Connection
Dim recMyRecordSet As Recordset
Dim comMyCommand As Command

Private Sub Form_Load()
Set cnMyConnection = New Connection
Set recMyRecordSet = New Recordset
Set comMyCommand = New Command

' Establish connection
With cnMyConnection
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=sa;" & _
"Data Source = WEBDEV;" & _
"Initial Catalog = Optout"

.Open
End With

' Create a command object
With comMyCommand
.ActiveConnection = cnMyConnection
.CommandText = "SELECT * FROM OptOut"

' Build the record set
Set recMyRecordSet = comMyCommand.Execute
End With
End Sub


I've been trying to display the first_name and last_name but I've been unsucssefull.
Also can I set these properties at deign time.

Thanks,
Sergio Ortiz
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform