Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie question: How to check for a tables existence in a smart (fast) way ??
Hi,
You can use the following function
Function TableExists(strTableName As String) As Boolean
' This procedure returns True or False depending on whether ' the table named in strTableName exists. Dim dbs As Database, tdf As TableDef
On Error Resume Next
Set dbs = CurrentDb
Set tdf = dbs.TableDefs(strTableName)
If Err = 3265 Then
' Table does not exist. TableExists = False Else ' Table exists. TableExists = True
HTH
-- Dev Ashish --------------- Check these out before posting your questions........ Hit F1 when using Access. It REALLY helps!!!!!! http://www.dejanews.com - Have you been here today?? http://www.reference.com - Alternate for searching newsgroups. http://www.altavista.digital.com/ - Search web/usenet posts. http://www.microsoft.com/kb/default.asp - Get your answers here!! -------------- Jørgen Haukland wrote in message <6935n9$nrp_at_info.telenor.no>...Received on Thu Jan 08 1998 - 00:00:00 CST
>Hey !
>
>I'm working on an application and need to create some tables if they don't
>already exists - sometimes they do. I've tried to find a smart SQL
statement
>but i end up with something that lists smaller or larger parts of the
table.
>This is no good solution because this table can occasionally be quite large
>(50 - 60 MB). I need a statement that don't do any searching in the table,
>just sees if it's there.
>
>Any suggestions ??
>
>Private e-mails are welcome as long as they also are submitted to the
group.
>
>Joergen Haukland
>NORWAY
>
>e-mail: jorgen.haukland_at_fou.telenor.no
>
>
![]() |
![]() |