Advertisement

04.21.2004 at 06:02AM PDT, ID: 20961833
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Problem with OleDB Provider

Asked by iboutchkine in .NET

Tags:

I have a weird problem. I am trying to update the Access database.
When I am using OleDbProvider, I am getting an error in SQL statement for Update (select and insert
works fine)

Imports System.Data.Odbc

        Dim cmd As OleDbCommand = New OleDbCommand

        Dim sDBName As String = Server.MapPath("IP.mdb")
        Dim sConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                     "Data Source=" & sDBName & ";Persist Security Info=False;"

        Dim cn As New OleDbConnection(sConn)
        cn.Open()
.......
'here is my update SQL and all the setting for command object
..........
            cmd.ExecuteNonQuery()

During update I am getting an error :  "Error in UPDATE statement"

I have changed OLEDB Provider to ODBC driver

Imports System.Data.Odbc

        Dim cmd As OdbcCommand = New OdbcCommand

        Dim sDBName As String = Server.MapPath("IP.mdb")
        Dim sConn As String = "Driver={Microsoft Access Driver (*.mdb)};" & _
                  "DBQ=" & sDBName & ";UID=;PWD="

        Dim cn As New OdbcConnection(sConn)
        cn.Open()

using the same code and the same SQL. Everything works fine

I am sure that SQL is correct (don't look here)
All permissions are OK ( because I can write to DB with ODBC provider)

More Info
I have the latest MDAC, Jet Engine and Servivce packs
OS - Win XP Professional

What can cause this problem with OleDBProvider? I can do select and insert statement but getting problem wiht update. Is it a bug?
Start Free Trial
 
Loading Advertisement...
 
[+][-]04.21.2004 at 06:20AM PDT, ID: 10877869

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: provider
Sign Up Now!
Solution Provided By: Jarodtweiss
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.21.2004 at 06:54AM PDT, ID: 10878286

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32