Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert Data from a form to a table using the INSERT Comm
Message
From
17/12/2001 20:48:42
 
 
To
12/12/2001 19:45:55
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00593665
Message ID:
00595426
Views:
16
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
Map
View

Click here to load this message in the networking platform