473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Inser into mdb from asp.net page

Hello,
I can't get info from my web form into my Access database.
The connection works.
I've tried a command with CommandText = "Insert Into..."
Error! "You have to have a query that allows changes..."
With DataAdapter and Dataset I don't get any errors, but
the record isn't added either.
Sequrity issues?

Grateful for any tip,
Kristian Karre
Nov 19 '05 #1
10 1277
Hi Kristian,

Do you have the full error string? That would be helpful.

My first recommendation would be for you to check the properties of the mdb.
Is it marked as read-only? If it is, you will also need to recreate your
connection string, as it will have stored a mode attribute set to 'Read',
which should be set 'Share Deny None'.

Try this and see if it helps! If not, post a bit more information.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
Hello,
I can't get info from my web form into my Access database.
The connection works.
I've tried a command with CommandText = "Insert Into..."
Error! "You have to have a query that allows changes..."
With DataAdapter and Dataset I don't get any errors, but
the record isn't added either.
Sequrity issues?

Grateful for any tip,
Kristian Karre

Nov 19 '05 #2
Hi Stuart,
I think you're on to something.
I CAN enter a new record when connecting to a mdb in a "normal" folder, but
not to the one on the website on IIS.
I'm using a web hotel and don't know how to get the complete error message,
but if you could tell me how to adjust the connectionstring so "Share Deny
none" is included that might work.

TiA, Kristian

"Stuart A Hill" wrote:
Hi Kristian,

Do you have the full error string? That would be helpful.

My first recommendation would be for you to check the properties of the mdb.
Is it marked as read-only? If it is, you will also need to recreate your
connection string, as it will have stored a mode attribute set to 'Read',
which should be set 'Share Deny None'.

Try this and see if it helps! If not, post a bit more information.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
Hello,
I can't get info from my web form into my Access database.
The connection works.
I've tried a command with CommandText = "Insert Into..."
Error! "You have to have a query that allows changes..."
With DataAdapter and Dataset I don't get any errors, but
the record isn't added either.
Sequrity issues?

Grateful for any tip,
Kristian Karre


Nov 19 '05 #3
I had the similar problem before. What I did is set Everyone has "full
control" access right on mdb file. And then it works fine. It sounds weird.
But, it works, I don't know why.

"Kristian" wrote:
Hi Stuart,
I think you're on to something.
I CAN enter a new record when connecting to a mdb in a "normal" folder, but
not to the one on the website on IIS.
I'm using a web hotel and don't know how to get the complete error message,
but if you could tell me how to adjust the connectionstring so "Share Deny
none" is included that might work.

TiA, Kristian

"Stuart A Hill" wrote:
Hi Kristian,

Do you have the full error string? That would be helpful.

My first recommendation would be for you to check the properties of the mdb.
Is it marked as read-only? If it is, you will also need to recreate your
connection string, as it will have stored a mode attribute set to 'Read',
which should be set 'Share Deny None'.

Try this and see if it helps! If not, post a bit more information.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
Hello,
I can't get info from my web form into my Access database.
The connection works.
I've tried a command with CommandText = "Insert Into..."
Error! "You have to have a query that allows changes..."
With DataAdapter and Dataset I don't get any errors, but
the record isn't added either.
Sequrity issues?

Grateful for any tip,
Kristian Karre


Nov 19 '05 #4
Hi Kristian,

Are you using Visual Studio? The quickest way to check the connection string
is to create a data link in the Server Explorer window to your access
database (Right-Click the data connections folder and select 'Add
Connection'), and then drag the database from the Server Explorer to a web
form. This will create a connection object, which will contain all the
connection string attributes. However, in case you are not using Visual
Studio, and if not why not ;-) I have done this for you below: (You are
looking for the Mode attribute)

ReadOnly Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Read;Jet OLEDB:New
Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

ReadWrite Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

If this doesn't work then the next thing to look at would be a permissions
setting on the folder itself.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
Hi Stuart,
I think you're on to something.
I CAN enter a new record when connecting to a mdb in a "normal" folder,
but
not to the one on the website on IIS.
I'm using a web hotel and don't know how to get the complete error
message,
but if you could tell me how to adjust the connectionstring so "Share Deny
none" is included that might work.

TiA, Kristian

"Stuart A Hill" wrote:
Hi Kristian,

Do you have the full error string? That would be helpful.

My first recommendation would be for you to check the properties of the
mdb.
Is it marked as read-only? If it is, you will also need to recreate your
connection string, as it will have stored a mode attribute set to 'Read',
which should be set 'Share Deny None'.

Try this and see if it helps! If not, post a bit more information.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
> Hello,
> I can't get info from my web form into my Access database.
> The connection works.
> I've tried a command with CommandText = "Insert Into..."
> Error! "You have to have a query that allows changes..."
> With DataAdapter and Dataset I don't get any errors, but
> the record isn't added either.
> Sequrity issues?
>
> Grateful for any tip,
> Kristian Karre


Nov 19 '05 #5
I'm trying out at my local laptop that's got IIS installed.
I'm using VS .NET, created OleDbConnection object via drag and drop
(Mode=Share Deny None)
The Folder is set to allow anything, the mdb is not write protected...
Doesn't the code (or sap .net) have the same rights as I do?

This was way more tricky than I thought!
Any more ideas?
Hopeful,
Kristian
"Stuart A Hill" wrote:
Hi Kristian,

Are you using Visual Studio? The quickest way to check the connection string
is to create a data link in the Server Explorer window to your access
database (Right-Click the data connections folder and select 'Add
Connection'), and then drag the database from the Server Explorer to a web
form. This will create a connection object, which will contain all the
connection string attributes. However, in case you are not using Visual
Studio, and if not why not ;-) I have done this for you below: (You are
looking for the Mode attribute)

ReadOnly Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Read;Jet OLEDB:New
Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

ReadWrite Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

If this doesn't work then the next thing to look at would be a permissions
setting on the folder itself.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
Hi Stuart,
I think you're on to something.
I CAN enter a new record when connecting to a mdb in a "normal" folder,
but
not to the one on the website on IIS.
I'm using a web hotel and don't know how to get the complete error
message,
but if you could tell me how to adjust the connectionstring so "Share Deny
none" is included that might work.

TiA, Kristian

"Stuart A Hill" wrote:
Hi Kristian,

Do you have the full error string? That would be helpful.

My first recommendation would be for you to check the properties of the
mdb.
Is it marked as read-only? If it is, you will also need to recreate your
connection string, as it will have stored a mode attribute set to 'Read',
which should be set 'Share Deny None'.

Try this and see if it helps! If not, post a bit more information.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
> Hello,
> I can't get info from my web form into my Access database.
> The connection works.
> I've tried a command with CommandText = "Insert Into..."
> Error! "You have to have a query that allows changes..."
> With DataAdapter and Dataset I don't get any errors, but
> the record isn't added either.
> Sequrity issues?
>
> Grateful for any tip,
> Kristian Karre


Nov 19 '05 #6
I have seen that error before.
It can come from a query that has bad syntax.

Please post your code for the query (including parameters.)
BTW - Access does not use named parameters.
When you build them up, you have to apply them in the same sequence.
If they are out of order you could get this error.
--
Joe Fallon


"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
I'm trying out at my local laptop that's got IIS installed.
I'm using VS .NET, created OleDbConnection object via drag and drop
(Mode=Share Deny None)
The Folder is set to allow anything, the mdb is not write protected...
Doesn't the code (or sap .net) have the same rights as I do?

This was way more tricky than I thought!
Any more ideas?
Hopeful,
Kristian
"Stuart A Hill" wrote:
Hi Kristian,

Are you using Visual Studio? The quickest way to check the connection
string
is to create a data link in the Server Explorer window to your access
database (Right-Click the data connections folder and select 'Add
Connection'), and then drag the database from the Server Explorer to a
web
form. This will create a connection object, which will contain all the
connection string attributes. However, in case you are not using Visual
Studio, and if not why not ;-) I have done this for you below: (You are
looking for the Mode attribute)

ReadOnly Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Read;Jet
OLEDB:New
Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

ReadWrite Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
None;Jet
OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without
Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

If this doesn't work then the next thing to look at would be a
permissions
setting on the folder itself.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
> Hi Stuart,
> I think you're on to something.
> I CAN enter a new record when connecting to a mdb in a "normal" folder,
> but
> not to the one on the website on IIS.
> I'm using a web hotel and don't know how to get the complete error
> message,
> but if you could tell me how to adjust the connectionstring so "Share
> Deny
> none" is included that might work.
>
> TiA, Kristian
>
> "Stuart A Hill" wrote:
>
>> Hi Kristian,
>>
>> Do you have the full error string? That would be helpful.
>>
>> My first recommendation would be for you to check the properties of
>> the
>> mdb.
>> Is it marked as read-only? If it is, you will also need to recreate
>> your
>> connection string, as it will have stored a mode attribute set to
>> 'Read',
>> which should be set 'Share Deny None'.
>>
>> Try this and see if it helps! If not, post a bit more information.
>>
>> Regards,
>>
>> Stuart
>> MCSD, MCT
>>
>> "Kristian" <Kr******@discussions.microsoft.com> wrote in message
>> news:3A**********************************@microsof t.com...
>> > Hello,
>> > I can't get info from my web form into my Access database.
>> > The connection works.
>> > I've tried a command with CommandText = "Insert Into..."
>> > Error! "You have to have a query that allows changes..."
>> > With DataAdapter and Dataset I don't get any errors, but
>> > the record isn't added either.
>> > Sequrity issues?
>> >
>> > Grateful for any tip,
>> > Kristian Karre
>>
>>
>>


Nov 19 '05 #7
The connection - seems to work is this:
cnDb.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\SLSwebbApp\db_Axs\sls.md b;Persist Security
Info=False"

The insert command is this:
cmdIns.CommandText = _
"INSERT INTO Personer ( Företag, FNamn, ENamn, Adressrad1,
Adressrad2, Pnr, Ort, Tfn1, Tfn2, Epost,Medlem, Medlemsnr, Instruktör, Aktiv,
Livinfo) Values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
The parameters read as follows:

cmdIns.Parameters.Add("?Företag", OleDb.OleDbType.VarChar,
80).Value = Me.txtFtag.Text
cmdIns.Parameters.Add("?FNamn", OleDb.OleDbType.VarChar,
80).Value = Me.txtFNamn.Text
cmdIns.Parameters.Add("?ENamn", OleDb.OleDbType.VarChar,
80).Value = Me.txtENamn.Text
cmdIns.Parameters.Add("?Adressrad1", OleDb.OleDbType.VarChar,
80).Value = Me.txtAdr1.Text
cmdIns.Parameters.Add("?Adressrad2", OleDb.OleDbType.VarChar,
80).Value = Me.txtAdr2.Text
cmdIns.Parameters.Add("?Pnr", OleDb.OleDbType.VarChar, 80).Value
= Me.txtPnr.Text
cmdIns.Parameters.Add("?Ort", OleDb.OleDbType.VarChar, 80).Value
= Me.txtOrt.Text
cmdIns.Parameters.Add("?Tfn1", OleDb.OleDbType.VarChar,
80).Value = Me.txtTfn1.Text
cmdIns.Parameters.Add("?Tfn2", OleDb.OleDbType.VarChar,
80).Value = Me.txtTfn2.Text
cmdIns.Parameters.Add("?Epost", OleDb.OleDbType.VarChar,
80).Value = Me.txtEpost.Text
cmdIns.Parameters.Add("?Medlem", OleDb.OleDbType.Boolean).Value
= Me.chkMedlem.Checked
cmdIns.Parameters.Add("?Epost", OleDb.OleDbType.VarChar,
80).Value = Me.txtMedlNr.Text
cmdIns.Parameters.Add("?Instruktör",
OleDb.OleDbType.Boolean).Value = Me.chkInstr.Checked
cmdIns.Parameters.Add("?Aktiv", OleDb.OleDbType.Boolean).Value =
Me.chkAktiv.Checked
cmdIns.Parameters.Add("?Livinfo", OleDb.OleDbType.Boolean).Value
= Me.chkVillHaInfo.Checked
cmdIns.Connection = cnDb
AntalInfogade = cmdIns.ExecuteNonQuery()

Grateful for anything that could take me closer to a solution...
Kristian

"Joe Fallon" wrote:
I have seen that error before.
It can come from a query that has bad syntax.

Please post your code for the query (including parameters.)
BTW - Access does not use named parameters.
When you build them up, you have to apply them in the same sequence.
If they are out of order you could get this error.
--
Joe Fallon


"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
I'm trying out at my local laptop that's got IIS installed.
I'm using VS .NET, created OleDbConnection object via drag and drop
(Mode=Share Deny None)
The Folder is set to allow anything, the mdb is not write protected...
Doesn't the code (or sap .net) have the same rights as I do?

This was way more tricky than I thought!
Any more ideas?
Hopeful,
Kristian
"Stuart A Hill" wrote:
Hi Kristian,

Are you using Visual Studio? The quickest way to check the connection
string
is to create a data link in the Server Explorer window to your access
database (Right-Click the data connections folder and select 'Add
Connection'), and then drag the database from the Server Explorer to a
web
form. This will create a connection object, which will contain all the
connection string attributes. However, in case you are not using Visual
Studio, and if not why not ;-) I have done this for you below: (You are
looking for the Mode attribute)

ReadOnly Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Read;Jet
OLEDB:New
Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

ReadWrite Connection String:

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data
Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
None;Jet
OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without
Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False

If this doesn't work then the next thing to look at would be a
permissions
setting on the folder itself.

Regards,

Stuart
MCSD, MCT

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
> Hi Stuart,
> I think you're on to something.
> I CAN enter a new record when connecting to a mdb in a "normal" folder,
> but
> not to the one on the website on IIS.
> I'm using a web hotel and don't know how to get the complete error
> message,
> but if you could tell me how to adjust the connectionstring so "Share
> Deny
> none" is included that might work.
>
> TiA, Kristian
>
> "Stuart A Hill" wrote:
>
>> Hi Kristian,
>>
>> Do you have the full error string? That would be helpful.
>>
>> My first recommendation would be for you to check the properties of
>> the
>> mdb.
>> Is it marked as read-only? If it is, you will also need to recreate
>> your
>> connection string, as it will have stored a mode attribute set to
>> 'Read',
>> which should be set 'Share Deny None'.
>>
>> Try this and see if it helps! If not, post a bit more information.
>>
>> Regards,
>>
>> Stuart
>> MCSD, MCT
>>
>> "Kristian" <Kr******@discussions.microsoft.com> wrote in message
>> news:3A**********************************@microsof t.com...
>> > Hello,
>> > I can't get info from my web form into my Access database.
>> > The connection works.
>> > I've tried a command with CommandText = "Insert Into..."
>> > Error! "You have to have a query that allows changes..."
>> > With DataAdapter and Dataset I don't get any errors, but
>> > the record isn't added either.
>> > Sequrity issues?
>> >
>> > Grateful for any tip,
>> > Kristian Karre
>>
>>
>>


Nov 19 '05 #8
I believe it has to do with my connections.
I can pull info from the db, put cannot add records, nor update.
Sholud I use Ole Db provider for ODBC or "simple provider or OLE DB-provider
if I want to access a mdb with full rights?
ShareDenyNone seems hard to acccomplish...
And this is only localy on my "web server".
What's to be expected on the Web Hotel?
He - EEELP!
Kristian

"Kristian" wrote:
The connection - seems to work is this:
cnDb.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\SLSwebbApp\db_Axs\sls.md b;Persist Security
Info=False"

The insert command is this:
cmdIns.CommandText = _
"INSERT INTO Personer ( Företag, FNamn, ENamn, Adressrad1,
Adressrad2, Pnr, Ort, Tfn1, Tfn2, Epost,Medlem, Medlemsnr, Instruktör, Aktiv,
Livinfo) Values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
The parameters read as follows:

cmdIns.Parameters.Add("?Företag", OleDb.OleDbType.VarChar,
80).Value = Me.txtFtag.Text
cmdIns.Parameters.Add("?FNamn", OleDb.OleDbType.VarChar,
80).Value = Me.txtFNamn.Text
cmdIns.Parameters.Add("?ENamn", OleDb.OleDbType.VarChar,
80).Value = Me.txtENamn.Text
cmdIns.Parameters.Add("?Adressrad1", OleDb.OleDbType.VarChar,
80).Value = Me.txtAdr1.Text
cmdIns.Parameters.Add("?Adressrad2", OleDb.OleDbType.VarChar,
80).Value = Me.txtAdr2.Text
cmdIns.Parameters.Add("?Pnr", OleDb.OleDbType.VarChar, 80).Value
= Me.txtPnr.Text
cmdIns.Parameters.Add("?Ort", OleDb.OleDbType.VarChar, 80).Value
= Me.txtOrt.Text
cmdIns.Parameters.Add("?Tfn1", OleDb.OleDbType.VarChar,
80).Value = Me.txtTfn1.Text
cmdIns.Parameters.Add("?Tfn2", OleDb.OleDbType.VarChar,
80).Value = Me.txtTfn2.Text
cmdIns.Parameters.Add("?Epost", OleDb.OleDbType.VarChar,
80).Value = Me.txtEpost.Text
cmdIns.Parameters.Add("?Medlem", OleDb.OleDbType.Boolean).Value
= Me.chkMedlem.Checked
cmdIns.Parameters.Add("?Epost", OleDb.OleDbType.VarChar,
80).Value = Me.txtMedlNr.Text
cmdIns.Parameters.Add("?Instruktör",
OleDb.OleDbType.Boolean).Value = Me.chkInstr.Checked
cmdIns.Parameters.Add("?Aktiv", OleDb.OleDbType.Boolean).Value =
Me.chkAktiv.Checked
cmdIns.Parameters.Add("?Livinfo", OleDb.OleDbType.Boolean).Value
= Me.chkVillHaInfo.Checked
cmdIns.Connection = cnDb
AntalInfogade = cmdIns.ExecuteNonQuery()

Grateful for anything that could take me closer to a solution...
Kristian

"Joe Fallon" wrote:
I have seen that error before.
It can come from a query that has bad syntax.

Please post your code for the query (including parameters.)
BTW - Access does not use named parameters.
When you build them up, you have to apply them in the same sequence.
If they are out of order you could get this error.
--
Joe Fallon


"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
I'm trying out at my local laptop that's got IIS installed.
I'm using VS .NET, created OleDbConnection object via drag and drop
(Mode=Share Deny None)
The Folder is set to allow anything, the mdb is not write protected...
Doesn't the code (or sap .net) have the same rights as I do?

This was way more tricky than I thought!
Any more ideas?
Hopeful,
Kristian
"Stuart A Hill" wrote:

> Hi Kristian,
>
> Are you using Visual Studio? The quickest way to check the connection
> string
> is to create a data link in the Server Explorer window to your access
> database (Right-Click the data connections folder and select 'Add
> Connection'), and then drag the database from the Server Explorer to a
> web
> form. This will create a connection object, which will contain all the
> connection string attributes. However, in case you are not using Visual
> Studio, and if not why not ;-) I have done this for you below: (You are
> looking for the Mode attribute)
>
> ReadOnly Connection String:
>
> Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
> OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=;Data
> Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
> Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
> database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Read;Jet
> OLEDB:New
> Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
> Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
> Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False
>
> ReadWrite Connection String:
>
> Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
> OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data
> Source="C:\trader.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
> Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0"; Jet OLEDB:System
> database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
> None;Jet
> OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet
> OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without
> Replica
> Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False
>
> If this doesn't work then the next thing to look at would be a
> permissions
> setting on the folder itself.
>
> Regards,
>
> Stuart
> MCSD, MCT
>
> "Kristian" <Kr******@discussions.microsoft.com> wrote in message
> news:75**********************************@microsof t.com...
> > Hi Stuart,
> > I think you're on to something.
> > I CAN enter a new record when connecting to a mdb in a "normal" folder,
> > but
> > not to the one on the website on IIS.
> > I'm using a web hotel and don't know how to get the complete error
> > message,
> > but if you could tell me how to adjust the connectionstring so "Share
> > Deny
> > none" is included that might work.
> >
> > TiA, Kristian
> >
> > "Stuart A Hill" wrote:
> >
> >> Hi Kristian,
> >>
> >> Do you have the full error string? That would be helpful.
> >>
> >> My first recommendation would be for you to check the properties of
> >> the
> >> mdb.
> >> Is it marked as read-only? If it is, you will also need to recreate
> >> your
> >> connection string, as it will have stored a mode attribute set to
> >> 'Read',
> >> which should be set 'Share Deny None'.
> >>
> >> Try this and see if it helps! If not, post a bit more information.
> >>
> >> Regards,
> >>
> >> Stuart
> >> MCSD, MCT
> >>
> >> "Kristian" <Kr******@discussions.microsoft.com> wrote in message
> >> news:3A**********************************@microsof t.com...
> >> > Hello,
> >> > I can't get info from my web form into my Access database.
> >> > The connection works.
> >> > I've tried a command with CommandText = "Insert Into..."
> >> > Error! "You have to have a query that allows changes..."
> >> > With DataAdapter and Dataset I don't get any errors, but
> >> > the record isn't added either.
> >> > Sequrity issues?
> >> >
> >> > Grateful for any tip,
> >> > Kristian Karre
> >>
> >>
> >>
>
>
>


Nov 19 '05 #9
I was facing a similar problem recently, and I found out that the account
the .NET Framework uses to execute ASP.NET applications didn't have the
correct rights to write to the MDB file. It's that simple!

The account under which your ASP.NET applications run is called "ASPNET" and
you need to grant it the necessary rights. I did it on my own machine by
making the account a member of the Administrators group, and I asked my "web
hotel" to create a special directory on my website and give the account
write access to it.

I don't know if this is the same issue as the person who asked the question
is facing, but it could be. Oh and just one more thing, when you add an
account to a group in Windows, you usually need to reboot the damn thing for
changes to take effect.

Hope this helps,
Michal

--
Michal Boleslav Mechura
va******@hotmail.com

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:91**********************************@microsof t.com...
I believe it has to do with my connections.
I can pull info from the db, put cannot add records, nor update.
Sholud I use Ole Db provider for ODBC or "simple provider or OLE
DB-provider
if I want to access a mdb with full rights?
ShareDenyNone seems hard to acccomplish...
And this is only localy on my "web server".
What's to be expected on the Web Hotel?
He - EEELP!
Kristian

[...]
Nov 19 '05 #10
Yes! This was it!
A million thanks!
Kristian

"Michal Boleslav Mechura" wrote:
I was facing a similar problem recently, and I found out that the account
the .NET Framework uses to execute ASP.NET applications didn't have the
correct rights to write to the MDB file. It's that simple!

The account under which your ASP.NET applications run is called "ASPNET" and
you need to grant it the necessary rights. I did it on my own machine by
making the account a member of the Administrators group, and I asked my "web
hotel" to create a special directory on my website and give the account
write access to it.

I don't know if this is the same issue as the person who asked the question
is facing, but it could be. Oh and just one more thing, when you add an
account to a group in Windows, you usually need to reboot the damn thing for
changes to take effect.

Hope this helps,
Michal

--
Michal Boleslav Mechura
va******@hotmail.com

"Kristian" <Kr******@discussions.microsoft.com> wrote in message
news:91**********************************@microsof t.com...
I believe it has to do with my connections.
I can pull info from the db, put cannot add records, nor update.
Sholud I use Ole Db provider for ODBC or "simple provider or OLE
DB-provider
if I want to access a mdb with full rights?
ShareDenyNone seems hard to acccomplish...
And this is only localy on my "web server".
What's to be expected on the Web Hotel?
He - EEELP!
Kristian

[...]

Nov 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
0
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as ...
2
by: James | last post by:
I've been to websites where if I navigate off a form, trying to get back to it by hitting the back button gives me a page which says "Warning, page has expired". It doesn't display the page. I've...
4
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
6
by: MooreSmnith | last post by:
When I navigate to the next page using Response.Rediect("MyNextPage.aspx") current page Page_Load event is called. What I may wrongly understood is that post back will happen whenever there is any...
4
by: Krij | last post by:
Hi! Can anybody tell me what I'm missing here? I'm trying to insert a new record into a sql-database from code at runtime (not stored procedure), but get the following error message: "The...
1
by: flash | last post by:
Need hlep to delete array only because all function is ok (inser, sort andsearch) #include <iostream.h> //functions prototype void Insert(int,int); void Delete(int,int); int...
2
by: wugon.net | last post by:
Problem: after inser trigger encounter error sql0348 Env:db2 v8 + fp 13 + win xp Description: we build two after insert triggers DB2.TRG1, DB2.TRG2 on base table DB2.TEST1, insert data into...
2
by: alivip | last post by:
when I wont to inser (anyting I print) to the textbox it will not inser it just print then hanging # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, #...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.