Inserting to Access Database

M

MA P

Hi!

Need help. I want to insert values from textbox-based input and upon
clicking the Create button, these command lines will run. It didn't work! It
points to the "test.Insert()" line that indicates that "Keyword not
supported: 'provider'". See the code behind below:

Protected Sub btnCreate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnCreate.Click
Dim test As SqlDataSource = New SqlDataSource()
test.ConnectionString =
ConfigurationManager.ConnectionStrings("dbaccountsCS").ToString
test.InsertCommand = "INSERT INTO [tblaccounts] ([UserName],
[FName], [LName], (e-mail address removed)
 
G

Guest

Hi

This definitely is a problem with the connection string. Why don't you post
your connection string here ? It would help to narrow down the problem.

Prem
 
M

MA P

Here is the connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\AccessDB\Test\dbaccounts.mdb

Prem Kumar said:
Hi

This definitely is a problem with the connection string. Why don't you
post
your connection string here ? It would help to narrow down the problem.

Prem

MA P said:
Hi!

Need help. I want to insert values from textbox-based input and upon
clicking the Create button, these command lines will run. It didn't work!
It
points to the "test.Insert()" line that indicates that "Keyword not
supported: 'provider'". See the code behind below:

Protected Sub btnCreate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnCreate.Click
Dim test As SqlDataSource = New SqlDataSource()
test.ConnectionString =
ConfigurationManager.ConnectionStrings("dbaccountsCS").ToString
test.InsertCommand = "INSERT INTO [tblaccounts] ([UserName],
[FName], [LName], (e-mail address removed)
 
M

Mark Rae

Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\AccessDB\Test\dbaccounts.mdb

1) Just a thought, but I presume that "C:\" in the above string refers to
the webserver's C:\ drive and not your own C:\drive, and that the database
file is actually there...?

2) Does the user that your site is running under have read/write permissions
not only on the file but also on the folder in which the file resides? The
Jet engine creates a locking database (.ldb) file in the same folder as the
database file whenever the file is opened, and removes it when the file is
closed...
 
M

MA P

I am still on the debugging stage of VWDE. I haven't deploy my web app.
Remember that the error that I am telling is "Keyword not supported". Please
review my original post.
 
M

MA P

Then reason for using SQLDataSource instead of AccessDataSource is I want to
separate Web Apps to the database. I don't know if its possible with
SQLDataSource. Hope you might help.
 
M

master_programmer

Suggest using a large text file (like an ini file) then looping through
each row.

The Master
 
G

Guest

Hi

Just a try, came across in a forum.

Remove the provider attribute and see what happens.

Prem

MA P said:
Here is the connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\AccessDB\Test\dbaccounts.mdb

Prem Kumar said:
Hi

This definitely is a problem with the connection string. Why don't you
post
your connection string here ? It would help to narrow down the problem.

Prem

MA P said:
Hi!

Need help. I want to insert values from textbox-based input and upon
clicking the Create button, these command lines will run. It didn't work!
It
points to the "test.Insert()" line that indicates that "Keyword not
supported: 'provider'". See the code behind below:

Protected Sub btnCreate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnCreate.Click
Dim test As SqlDataSource = New SqlDataSource()
test.ConnectionString =
ConfigurationManager.ConnectionStrings("dbaccountsCS").ToString
test.InsertCommand = "INSERT INTO [tblaccounts] ([UserName],
[FName], [LName], (e-mail address removed)
 
M

MA P

How can I remove the provider attribute since it was automatically set by
VWD.
Prem Kumar said:
Hi

Just a try, came across in a forum.

Remove the provider attribute and see what happens.

Prem

MA P said:
Here is the connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\AccessDB\Test\dbaccounts.mdb

Prem Kumar said:
Hi

This definitely is a problem with the connection string. Why don't you
post
your connection string here ? It would help to narrow down the problem.

Prem

:

Hi!

Need help. I want to insert values from textbox-based input and upon
clicking the Create button, these command lines will run. It didn't
work!
It
points to the "test.Insert()" line that indicates that "Keyword not
supported: 'provider'". See the code behind below:

Protected Sub btnCreate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnCreate.Click
Dim test As SqlDataSource = New SqlDataSource()
test.ConnectionString =
ConfigurationManager.ConnectionStrings("dbaccountsCS").ToString
test.InsertCommand = "INSERT INTO [tblaccounts] ([UserName],
[FName], [LName], (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top