rita tielemans
2004-04-01 21:58:58 UTC
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
%>
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
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