Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert Data from a form to a table using the INSERT Comm
Message
De
17/12/2001 20:48:42
 
 
À
12/12/2001 19:45:55
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00593665
Message ID:
00595426
Vues:
17
You will first need to make a referance to ADO, then you will need to declare an ADO connection and Command that will look like this:

dim MyADOConnection as Adodb.connection
dim MyADOCommand as adodb.command

set MyADOConnection = new adodb.connection
set MyADOCommand = new adodb.command

Declare variables to hold the value's of your text boxes and assign the value's of the text boxes to them:

dim strText1 as sting


dim intText2 as integer
and so forth

strText1 = Text1.text
strText2 = Text2.text

Declare a variable to hold your connection string and assign the connectionstring to it:
dim strConnectionString as string

strConnectionstring = ""Provider=Microsoft.Jet.OLEDB.4.0;Data Source=YourFilePathToYourAccessDB;Persist Security Info=False"

Declare a variable to hold you insert statement and assign the statement to it:

dim strInsertStatement as string
strInsertStatement = "Insert into MyTable (Column1,Column2) Values (strText1, strText2);"

Hope this helps.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform