Thread: VB - Database problem

  1. #1

    VB - Database problem

    Hello. I'm making a program in VB that uses an Access database. I've made a function that fill out a list with entries from this database. I get the following error:

    "Runtime error '-2147217904 (80040e10)':
    No value given for one or more required parameters.

    This sentence is making the problem:

    Res.Open Sql, Con, adOpenDynamic

    res = an adodb.recordset variable
    sql = a string with an sql sentence that i've checked. It's valid.
    con = connection string:
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\" & "db.mdb;Persist Security Info=False"

    Does anyone have any idea what i'm doing wrong ?

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    http://support.microsoft.com/default...b;en-us;216425
    http://www.google.com/search?q=80040e10

    [EDIT: Incorrect information about App.Path removed]

    Check your connection string and SQL string with a MsgBox before trying to use them.
    Last edited by anonytmouse; 01-07-2005 at 02:48 AM.

  3. #3
    Yes, it does return the whole path which is the idea because then i can move my files whichever way i want. It's also great for when it's done so other people can install the program where they want.

    I did check these things with a msgbox, but now i did it again and it seems con gets a lot more text than i put:

    (picture)

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    It looks like it gets default options added. The problem is with your SQL statement, as detailed in the links. Check the field names in the SQL statement. There might be a typo in your database rather than in the SQL statement.

  5. #5
    ooh, stupid me. I always called my id columns "id", but because i have more than one database in my .mdb file i decided to call on of the id fields "langid" instead so i didn't have to define with database i was fetching the id number from i feel so stupid. oh well, thank you very much.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with Creating File for File Processing
    By Dampecram in forum C Programming
    Replies: 2
    Last Post: 12-07-2008, 01:26 AM
  2. a problem with a memory management
    By eight8ball in forum C Programming
    Replies: 5
    Last Post: 04-14-2008, 03:43 AM
  3. Passing an Array of Strings from VB to a C DLL
    By mr_nice! in forum Windows Programming
    Replies: 9
    Last Post: 03-08-2005, 06:16 AM
  4. database application help.
    By Billy Baroo in forum Linux Programming
    Replies: 1
    Last Post: 09-02-2002, 06:23 PM
  5. Sending a string to C++ from VB 6.
    By VirtualAce in forum C++ Programming
    Replies: 4
    Last Post: 08-21-2001, 02:28 AM