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 ?
[EDIT: Incorrect information about App.Path removed]
Check your connection string and SQL string with a MsgBox before trying to use them.
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:
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.
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.