Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bounding TextControl to fields.
Message
De
27/03/2001 09:29:43
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
 
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00488669
Message ID:
00488952
Vues:
7
Eric,
I tested the code and I was able to bind the fields to the Textboxes.
The problem with the code is that it does not allow me to navigate through the records. So I guess I will need to set the CursorType property of the RecordSet??.

I tested your code with the following modification:


Set cnMyConnection = New Connection
Set recMyRecordSet = New Recordset
Set comMyCommand = New Command

' Establish connection

With cnMyConnection
'.ConnectionString = "Provider=SQLOLEDB;Integrated Security=SSPI;Initial Catalog=OptOut;Data Source=Webdev"
.ConnectionString = "User ID=sa;Provider=SQLOLEDB;Initial Catalog=OptOut;Data Source=Webdev"

.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

With Text1
Set .DataSource = recMyRecordSet
.DataField = "last_name"
End With

With Text2
Set .DataSource = recMyRecordSet
.DataField = "first_name"
End With


End Sub


(How do you the change to white the background of the screen when displaying code?)
Thanks,
Sergio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform