Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2003, 05:46 AM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Teon
Default Need help here ...

I had write some statements like below

---------------------------------------------------------------------

    strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                    "Data Source=C:db.mdb"

    objConnection = New OleDbConnection(strConnection)
    objConnection.Open()

    strSQL = "INSERT INTO `Employees` ( `FirstName` , `LastName` VALUES ( 'Teon' , 'Ooi' )"

    objCmd = New OleDbCommand(strSQL, objConnection)

    objCmd.ExecuteNonQuery()

---------------------------------------------------------------------

I run it and get "Operation must use an updateable query" in the browser.

Can anyone help me? I don't know what wrong with it!:(


 
Old September 17th, 2003, 08:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Data Source=c:/<folder name>/db.mdb

Try that for starters.

Also check security permissions on the database. Make sure the <machine name>\aspnet and iusr_<machine name> accounts have write access to the db or make sure the appropriate people can write to the database.
 
Old September 17th, 2003, 10:56 AM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Teon
Default

Can you show me how to check the security permissions on the database and <machine name>\aspnet and iusr_<machine name> accounts' write access?

 
Old September 17th, 2003, 12:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

What Operating System do you have?
 
Old September 17th, 2003, 12:58 PM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Teon
Default

I am using WinXP Pro.
Sorry if I cause you trouble.

 
Old September 17th, 2003, 01:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

No problem.

Open 'My Computer'. Click 'Tools' and then 'Folder Options'. Then click on the 'View' Tab and scroll all the way to the bottom. Uncheck 'Use Simple File Sharing(Recommended)' and click 'Ok' or 'Yes' to the warning.

Once that has been done you should be able to go the the folder where your db.mdb is at and right click on the folder and give <machine name>\aspnet and iusr_<machine name> accounts write access to the folder.
 
Old September 17th, 2003, 04:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you are lacking a parenthesis in this

strSQL = "INSERT INTO `Employees` ( `FirstName` , `LastName` VALUES ( 'Teon' , 'Ooi' )"

... you should should be able to do like this...

strSQL = "INSERT INTO Employees VALUES ('Teon', 'Ooi')"

Hope it helps.

Jacob.

 
Old September 17th, 2003, 11:10 PM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Teon
Default

It works ! Thank you. :)










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.