Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement