Discussion:
Missing Column Issues
(too old to reply)
rita tielemans
2004-04-01 21:58:58 UTC
Permalink
hi joseph,

i'm not such an expert myself, but...
is it ADODB you're using?
if so, you can check the number of fields in a given recordset with:
rs.fields.count
you can also itterate all fields in a given recordset with:
for each fd in rs.fields
.....
next

check out the following ASP-code

<%
Dim cn, db, rs, fd, i, j

cn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
Server.MapPath("./Example.mdb")
set db = server.createobject("ADODB.connection")
set rs = server.createobject("ADODB.recordset")
db.open cn
rs.open "SELECT * FROM tblExample;",db,3,3

i=rs.fields.count
response.write(i & "<br>")

for j=0 to i-1
response.write(rs.fields(j).name & "<br>")
next

for each fd in rs.fields
response.write(fd.name & "<br>")
next
%>
Hello,
I have an application where the user is using an Access data to work
with a schedule. The user is not using the database properly and often
messes things up.
There is a column the client is using in some tables now, but not in
others. I have one page that displays all tables. For those tables
without this column in question, the page displays an error message.
How can I check to see if that column exists in a specific table?
Better question, how do I make the error message not be there for
those tables without the column?
Best regards,
Joseph Parchem
Rocket Roger
2004-04-02 07:37:33 UTC
Permalink
You could create an asp page that will display the table information
for the database table!
You will see all information that is posted to the database.

If you need some more help with this contact me.
Hello,
I have an application where the user is using an Access data to work
with a schedule. The user is not using the database properly and often
messes things up.
There is a column the client is using in some tables now, but not in
others. I have one page that displays all tables. For those tables
without this column in question, the page displays an error message.
How can I check to see if that column exists in a specific table?
Better question, how do I make the error message not be there for
those tables without the column?
Best regards,
Joseph Parchem
Loading...