By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,347 Members | 2,091 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,347 IT Pros & Developers. It's quick & easy.

Inser into mdb from asp.net page

P: n/a
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
Share this Question
Share on Google+
10 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.