Ask a Question related to ASP Database, Design and Development.
-
TylerB #1
Table Exists
I am wanting to check the existance of a table in my informix db
before I query it, since if I query a table that does not exist, it'll
blow up on me.
Anyone know the syntax on this? My code currently looks like this:
Set rsMachineOwner = Server.CreateObject("ADODB.Recordset")
MOQ = "SELECT * FROM ari.units WHERE u_id='"& thisPage.getUnitID()
&"'"
rsMachineOwner.Open MOQ, Conn1,3,1
if not rsMachineOwner.EOF then
MachOwn = trim(rsMachineOwner("u_company"))
thisPage.setMachineOwner(MachOwn)
else
thisPage.setMachineOwner("")
end if
set rsMachineOwner = nothing
I do not need to use this piece of code in many cases, but I want to
make the code smart enough to handle it, so I won't need to copy this
code from project to project on an "as needed" basis.
Thanks!
Tyler
TylerB Guest
-
Table exists?
Hi, can anyone tell me, how to find out if a table in an MS Access DB exists? Also, I'd like to find out, if certain columns exits if a table... -
Check if table exists
ON.KG wrote: One thing to consider: you are making a trip to the database to determine if a table exists. If it exists, you are then making... -
Testing if a mysql table exists
Is there a simple way to test if a mysql table exists? JUST One line ! -
Is there anything like an 'exists table' method I can use?
I need to run a querry from an asp page only if a certain table exists in the data base. Is there any kind of method that can look at the database... -
Another user has modified the contents of this table or view; the database row you are modifying no longer exists in the database;
Hi, I am testing a trigger that and I am getting this error message saying "Another user has modified the contents of this table or view; the... -
Aaron Bertrand - MVP #2
Re: Table Exists
> I am wanting to check the existance of a table in my informix db
How could you possibly write a query against a table that you're not sure if> before I query it,
it exists or not???
Anyway, this is one way to check for a table in Informix:
SELECT COUNT(*) FROM systables WHERE tabname = 'your_table_name'
If this returns 0, the table doesn't exist. If it returns 1, it does. If
it returns more than 1, you have an issue.
A
Aaron Bertrand - MVP Guest



Reply With Quote

