Re: well, it worked in sqlserver Insert fails in oledb
From: Kurt Schroeder (KurtSchroeder_at_discussions.microsoft.com)
Date: 02/03/05
- Next message: Dumitru Sbenghe: "Re: sql parameter contained by another SqlParameterCollection"
- Previous message: Brian Brown: "Re: Maximum Fields in SELECT statement"
- In reply to: W.G. Ryan eMVP: "Re: well, it worked in sqlserver Insert fails in oledb"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 3 Feb 2005 06:17:08 -0800
Thank You for your reply.
Primary Key is typID as an auto Number, I replaced the param with a question
mark and i get the same problem. I even try:
Insert into typ (TypName) Values('Kris') What or who needs to be added to
the directory security for this file?
THanks
kes
"W.G. Ryan eMVP" wrote:
> First make sure you have a Key on the table and that you can actually write
> to the access db. Next, replace your params with ? and try it again.
>
> --
> W.G. Ryan MVP (Windows Embedded)
>
> TiBA Solutions
> www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
> "Kurt Schroeder" <KurtSchroeder@discussions.microsoft.com> wrote in message
> news:6108118E-D9CE-49FF-B267-2EF878A5111F@microsoft.com...
> > This insert does not work and i don't know why. I get the following error
> > System.Data.OleDb.OleDbException: Operation must use an updateable query.
> > on the cmdInsert.ExecuteNonQuery()
> > I'm sure it's going to be simple
> > thanks
> > kes
> > Function AddStone(ByVal thsStone)
> > Dim conAddStone As OleDbConnection
> > Dim strInsert As String
> > Dim cmdInsert As OleDbCommand
> > conAddStone = New
> > OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" &
> thsSitePath
> > & "db\damarstone.mdb")
> > strInsert = "Insert into typ (TypName) Values(@thsStone)"
> > cmdInsert = New OleDbCommand(strInsert, conAddStone)
> > 'cmdInsert.Parameters.Add("@thsStone", thsStone)
> > conAddStone.Open()
> > cmdInsert.ExecuteNonQuery()
> > conAddStone.Close()
> > End Function
>
>
>
- Next message: Dumitru Sbenghe: "Re: sql parameter contained by another SqlParameterCollection"
- Previous message: Brian Brown: "Re: Maximum Fields in SELECT statement"
- In reply to: W.G. Ryan eMVP: "Re: well, it worked in sqlserver Insert fails in oledb"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|