473,661 Members | 2,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Co unt - 1
If Left(db.TableDe fs(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 3287
On Sat, 19 Feb 2005 23:38:45 GMT, "deko" <de**@hotmail.c om> 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.Co unt - 1
If Left(db.TableDe fs(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

SourceTableNam e -

RecordCount - 249

ValidationRu le -

ValidationTe xt -

ConflictTabl e -

ReplicaFilte r -

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).Propert ies
Set prpdc = prps("DateCreat ed")
Set prprc = prps("RecordCou nt")
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.c om> 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).Propert ies
Set prpdc = prps("DateCreat ed")
Set prprc = prps("RecordCou nt")
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
2705
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 examine the responsible Node's identifier to see which TreeNode triggered the event? Analyzing the Node's Text string is undesirable because it would mean performing a string compare to a set of predefined strings. This is slower and not easily...
3
6426
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 already at the maximum allowed length. Originally, I wanted to make use of the SYSCAT.TABLES.TABLEID "internal identifier" but found that it is not unique. Surely DB2 must have some unique object identifiers somewhere that can be accessed by providing
6
30702
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 serial number would do fine, but on Googling it seems that some of the sample code will now laways work on W2K, and not without administrator rights. Hence my question - how can I consistently get a UNIQUE PC identifier using vb.net 2003 - not...
4
10119
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 to a user, i dont really need the Unique Identifier's to be sequential so i was considering using system.time.hour + system.time.minute. + system.time.second, but am worried about daylight savings and also people altering the time on the host PC.
2
6203
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 2005. Anyhow when I try to view/assign the unique identifier field and debug/ use watchlist I get this "????????" for the value of the unique identifier. I am able to create a text box with this unique identifier field and view it. Its just when...
8
2068
by: DaTurk | last post by:
Hi, I was just curious how you would go about creating a unique identifier with 3 ints.
4
4242
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. I have seen in some databases where they store the treenodes they are using some serial number of the node. I don't have a clue what that is, but can someone tell me if there is something that is unique to every node.
4
2366
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 then ship them out for most cases but some of our customers do provide their own machines.) Our concern is if somebody takes one of our machines and ghosts it so they have a complete copy of the machine, it will allow them to continue working. We...
13
3703
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() with 'identifier' is also used in some other place in the code which would make the 'identifier' not unique. Is that something that can be achieved in C++? Thanks
0
8855
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8758
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.