Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connecting to a data source
Message
 
À
22/05/2002 09:41:26
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00659879
Message ID:
00660007
Vues:
19
You already asked this question yesterday and someone replied asking why you are using ADOCE. Are you programming on a palm?


Also, "data source=\pda.cdb" means that this file will be located at the root of the current drive. Is this your case? Have you made a typo error and should read "data source=\pda.Mdb"

Finally, have a lookat http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForMicrosoftJet


>The following code, designed to connect to an Access Database, and populate a textbox with a value from a field(Name) in Table1. I keep getting the following message: "database '\pda.cdb' does not exist. It does exist. I have placed it in the working directory and also at the root of d: and modified the line to connDatabase.ConnectionString = "data source=d:\pda.cdb"
>
>PLEASE HELP!!!!!!!!!!!
>
>
Private Sub Command1_Click()
>Dim connDatabase
>Set connDatabase = CreateObject("ADOCE.Connection.3.0")
>connDatabase.ConnectionString = "data source=\pda.cdb"
>connDatabase.open
>
>Dim rs 'Create a variable for the Recordset object reference
>Set rs = CreateObject("adoce.recordset.3.0")
>rs.open "table1"
>Me.Text1.Text rs.Fields("firstfield").Value
>rs.Close
>Set rs = Nothing
>
>connDatabase.Close
>Set connDatabase = Nothing
>
>End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform