|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Inserting to Access DatabaseNeed 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], [Email], [Department],[Password]) VALUES (@UserName, @FName, @LName, @Email, @Dept, @Password)" test.InsertParameters.Add("UserName", txtUserName.Text) test.InsertParameters.Add("FName", txtFName.Text) test.InsertParameters.Add("LName", txtLName.Text) test.InsertParameters.Add("Email", txtEmail.Text) test.InsertParameters.Add("Dept", ddlDept.Text) test.InsertParameters.Add("Password", txtPass.Text) test.Insert() <<<<<<<<------ This line has an error Label7.Visible = True End Sub 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 Show quote "MA P" wrote: > 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], [Email], [Department],[Password]) VALUES (@UserName, > @FName, @LName, @Email, @Dept, @Password)" > > test.InsertParameters.Add("UserName", txtUserName.Text) > test.InsertParameters.Add("FName", txtFName.Text) > test.InsertParameters.Add("LName", txtLName.Text) > test.InsertParameters.Add("Email", txtEmail.Text) > test.InsertParameters.Add("Dept", ddlDept.Text) > test.InsertParameters.Add("Password", txtPass.Text) > > test.Insert() <<<<<<<<------ This line has an error > > Label7.Visible = True > > End Sub > > > Here is the connection string:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\AccessDB\Test\dbaccounts.mdb Show quote "Prem Kumar" <PremKu***@discussions.microsoft.com> wrote in message news:8C6D90CC-B2FA-4831-8847-09C6523EFCBC@microsoft.com... > 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" wrote: > >> 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], [Email], [Department],[Password]) VALUES (@UserName, >> @FName, @LName, @Email, @Dept, @Password)" >> >> test.InsertParameters.Add("UserName", txtUserName.Text) >> test.InsertParameters.Add("FName", txtFName.Text) >> test.InsertParameters.Add("LName", txtLName.Text) >> test.InsertParameters.Add("Email", txtEmail.Text) >> test.InsertParameters.Add("Dept", ddlDept.Text) >> test.InsertParameters.Add("Password", txtPass.Text) >> >> test.Insert() <<<<<<<<------ This line has an error >> >> Label7.Visible = True >> >> End Sub >> >> >> "MA P" <m***@textguru.ph> wrote in message 1) Just a thought, but I presume that "C:\" in the above string refers to news:Or3A64$zGHA.1292@TK2MSFTNGP03.phx.gbl... > Provider=Microsoft.Jet.OLEDB.4.0;Data > Source=C:\AccessDB\Test\dbaccounts.mdb 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... 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. Show quote "Mark Rae" <mark@markNOSPAMrae.com> wrote in message news:uysmXcA0GHA.4580@TK2MSFTNGP05.phx.gbl... > "MA P" <m***@textguru.ph> wrote in message > news:Or3A64$zGHA.1292@TK2MSFTNGP03.phx.gbl... > >> 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... > 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. Show quote "MA P" <m***@textguru.ph> wrote in message news:ecl4ATI0GHA.4560@TK2MSFTNGP04.phx.gbl... >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. > > "Mark Rae" <mark@markNOSPAMrae.com> wrote in message > news:uysmXcA0GHA.4580@TK2MSFTNGP05.phx.gbl... >> "MA P" <m***@textguru.ph> wrote in message >> news:Or3A64$zGHA.1292@TK2MSFTNGP03.phx.gbl... >> >>> 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... >> > > Suggest using a large text file (like an ini file) then looping through
each row. The Master MA P wrote: Show quote > 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. > "MA P" <m***@textguru.ph> wrote in message > news:ecl4ATI0GHA.4560@TK2MSFTNGP04.phx.gbl... > >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. > > > > "Mark Rae" <mark@markNOSPAMrae.com> wrote in message > > news:uysmXcA0GHA.4580@TK2MSFTNGP05.phx.gbl... > >> "MA P" <m***@textguru.ph> wrote in message > >> news:Or3A64$zGHA.1292@TK2MSFTNGP03.phx.gbl... > >> > >>> 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... > >> > > > > Hi
Just a try, came across in a forum. Remove the provider attribute and see what happens. Prem Show quote "MA P" wrote: > Here is the connection string: > > Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\AccessDB\Test\dbaccounts.mdb > > "Prem Kumar" <PremKu***@discussions.microsoft.com> wrote in message > news:8C6D90CC-B2FA-4831-8847-09C6523EFCBC@microsoft.com... > > 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" wrote: > > > >> 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], [Email], [Department],[Password]) VALUES (@UserName, > >> @FName, @LName, @Email, @Dept, @Password)" > >> > >> test.InsertParameters.Add("UserName", txtUserName.Text) > >> test.InsertParameters.Add("FName", txtFName.Text) > >> test.InsertParameters.Add("LName", txtLName.Text) > >> test.InsertParameters.Add("Email", txtEmail.Text) > >> test.InsertParameters.Add("Dept", ddlDept.Text) > >> test.InsertParameters.Add("Password", txtPass.Text) > >> > >> test.Insert() <<<<<<<<------ This line has an error > >> > >> Label7.Visible = True > >> > >> End Sub > >> > >> > >> > > > How can I remove the provider attribute since it was automatically set by
VWD. Show quote "Prem Kumar" <PremKu***@discussions.microsoft.com> wrote in message news:E2CCC5A6-31AC-4F5F-A4FB-C113E4BECB1F@microsoft.com... > Hi > > Just a try, came across in a forum. > > Remove the provider attribute and see what happens. > > Prem > > "MA P" wrote: > >> Here is the connection string: >> >> Provider=Microsoft.Jet.OLEDB.4.0;Data >> Source=C:\AccessDB\Test\dbaccounts.mdb >> >> "Prem Kumar" <PremKu***@discussions.microsoft.com> wrote in message >> news:8C6D90CC-B2FA-4831-8847-09C6523EFCBC@microsoft.com... >> > 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" wrote: >> > >> >> 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], [Email], [Department],[Password]) VALUES (@UserName, >> >> @FName, @LName, @Email, @Dept, @Password)" >> >> >> >> test.InsertParameters.Add("UserName", txtUserName.Text) >> >> test.InsertParameters.Add("FName", txtFName.Text) >> >> test.InsertParameters.Add("LName", txtLName.Text) >> >> test.InsertParameters.Add("Email", txtEmail.Text) >> >> test.InsertParameters.Add("Dept", ddlDept.Text) >> >> test.InsertParameters.Add("Password", txtPass.Text) >> >> >> >> test.Insert() <<<<<<<<------ This line has an error >> >> >> >> Label7.Visible = True >> >> >> >> End Sub >> >> >> >> >> >> >> >> >> |
|||||||||||||||||||||||