Results 1 to 3 of 3

Thread: Connection String Error

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    135

    Connection String Error

    I am trying to make a program for a WM5 Pocket PC.

    I want it to use an access db for storing all the data when I tried this:
    VB Code:
    1. Dim sqlCon As New Data.SqlClient.SqlConnection()
    2.         sqlCon.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=ProStudent.mdb"
    3.         'sqlCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\ProStudent.mdb;"
    4.         sqlCon.Open()

    It said that there was an option error with the connection string.

    What am i doing wrong? / What connection string should I use ?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Connection String Error

    You're using the wrong data access classes..... SQLClient is ONLY, I repeat ONLY for SQL Server. If you are trying to access an Access databse, use the OLEDBClient namespace. And use the JEt driver, not the access driver.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Connection String Error

    Hi,
    you can't access an access database directly from PPC - your options are SqlClient to access SqlServer or SqlCEClient to access SqlMobile on the device.
    There is an article here on accessing a database on the PPC and here on accessing SqlServer from your PPC.

    There are 3rd party solutions to access MDB's from the PPC, including 1 from my company, SqlLinkCE

    Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width