General information
Category:
Coding, syntax & commands
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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only