473,320 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to get unique identifier for Tabledef?

I have a situation where data is being imported from external tables. The
Import Wizard (File > Get External Data > Import) is used to create and
import tables from different sources (txt, xls, etc). The problem is that
previously imported tables can get replaced by new tables that are imported
with the same name (usually "Sheet1" from an Excel spreadsheet). This
screws up the internal import process that uses a temp table and code to
massage the data into the database. If I can get a unique identifier for
each tabledef after it's imported, I can avoid the problem.

I've looked at Tabledef properties:

For i = 0 To db.TableDefs.Count - 1
If Left(db.TableDefs(i).Name, 4) <> "MSys" Then
Set prps = db.TableDefs(i).Properties
For Each prp In prps
Debug.Print prp.Name & " - " & prp.Value
Next
End if
Next

[output]
Name - Sheet1

Updatable - True

DateCreated - 1/16/2005 9:40:26 AM

LastUpdated - 2/18/2005 10:53:53 PM

Connect -

Attributes - 0

SourceTableName -

RecordCount - 249

ValidationRule -

ValidationText -

ConflictTable -

ReplicaFilter -

But I'd rather have something besides name/date/recordcount as an
identifier. Is there any kind of GUID for tabledefs?

Thanks in advance.
Nov 13 '05 #1
3 3276
On Sat, 19 Feb 2005 23:38:45 GMT, "deko" <de**@hotmail.com> wrote:

Eh... rename each table after it has been imported?
-Tom.

I have a situation where data is being imported from external tables. The
Import Wizard (File > Get External Data > Import) is used to create and
import tables from different sources (txt, xls, etc). The problem is that
previously imported tables can get replaced by new tables that are imported
with the same name (usually "Sheet1" from an Excel spreadsheet). This
screws up the internal import process that uses a temp table and code to
massage the data into the database. If I can get a unique identifier for
each tabledef after it's imported, I can avoid the problem.

I've looked at Tabledef properties:

For i = 0 To db.TableDefs.Count - 1
If Left(db.TableDefs(i).Name, 4) <> "MSys" Then
Set prps = db.TableDefs(i).Properties
For Each prp In prps
Debug.Print prp.Name & " - " & prp.Value
Next
End if
Next

[output]
Name - Sheet1

Updatable - True

DateCreated - 1/16/2005 9:40:26 AM

LastUpdated - 2/18/2005 10:53:53 PM

Connect -

Attributes - 0

SourceTableName -

RecordCount - 249

ValidationRule -

ValidationText -

ConflictTable -

ReplicaFilter -

But I'd rather have something besides name/date/recordcount as an
identifier. Is there any kind of GUID for tabledefs?

Thanks in advance.


Nov 13 '05 #2
> Eh... rename each table after it has been imported?

nope. table names can't be changed (for other reasons)

I suppose I could just make my own Table GUID:

For i = 0 To tdfs.Count - 1
strTn = tdfs(i).Name
If Left(strTn, 4) <> "MSys" And _
Left(strTn, 1) <> "~" Then
Set prps = tdfs(i).Properties
Set prpdc = prps("DateCreated")
Set prprc = prps("RecordCount")
lngTid = Format(prpdc, "dns") & Right(prprc, 3)
End If
Next
Nov 13 '05 #3
On Sun, 20 Feb 2005 01:35:54 GMT, "deko" <de**@hotmail.com> wrote:

You can also add to the Properties collection.
-Tom.

Eh... rename each table after it has been imported?


nope. table names can't be changed (for other reasons)

I suppose I could just make my own Table GUID:

For i = 0 To tdfs.Count - 1
strTn = tdfs(i).Name
If Left(strTn, 4) <> "MSys" And _
Left(strTn, 1) <> "~" Then
Set prps = tdfs(i).Properties
Set prpdc = prps("DateCreated")
Set prprc = prps("RecordCount")
lngTid = Format(prpdc, "dns") & Right(prprc, 3)
End If
Next


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kilroy Programmer | last post by:
Is there a way to store a unique numeric identifier (say, for example, an int) into a TreeNode, so that when the TreeNode is checked (since CheckBoxes is enabled) the eventhandler AfterCheck() can...
3
by: RGow | last post by:
Hi all, I need to get a unique identifier for tables created in DB2 v8.1. I can't use the table name because I want to use the identifier as part of a trigger name and the table names are...
6
by: Paul Bromley | last post by:
Ok - I have given up on trying to find the active IP address for a given PC. For licensing purposes I need to retrive a unique identifier from the PC that the program is installed on. The Hard disk...
4
by: ba.hons | last post by:
Hello all, Was wondering if anyone could provide some info on what could be a possible solution to a problem am having. I have to generate a Unique Identifier in C# which I will use to assign...
2
by: Ken | last post by:
Hi, I have a form whose control source is a view from SQL server 2005 database. The view has a primary key that is a unique identifier field with keys generated by newid() function from SQL server...
8
by: DaTurk | last post by:
Hi, I was just curious how you would go about creating a unique identifier with 3 ints.
4
by: Rob Stevens | last post by:
Is there some sort of unique identifier in every treenode that is consistent? I was looking at the handle of every treenode, but it appears that the handle changes everytime the tree is built. ...
4
by: Mufasa | last post by:
I'm looking for a way to get a truly unique identifier for a machine for our client software. I'd like to have it so that there's little or no setup by the end user. (We set up the machines and...
13
by: mliptak | last post by:
I'm trying to implement logging in my application, so that each log message has its unique identifier, e.g. log(identifier, text) What I want to achieve is that the compiler screams if the log()...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.