News:

All posts discussing pricing or where to buy TurboCAD will be deleted.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Solved: Using Database Link Results in Sync of First Record in Table Only

Started by W359, September 02, 2012, 03:52:41 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

W359

Hello All!

I have been having a play with the database connectivity capabilities of TC. I am interested in populating custom properties for blocks from a MS-Access database.  The process seems straightforward enough:

1. Created a small MS-Access test database and a small table with 4 columns and four records.
2. Used the Database Palette to create a new data source using the MS Office 12.0 Access Database Engine OLE DB Provider
3. Entered the data source configuration information and tested the connection successfully.
4. Connected to the database and retrieved information from the table.
5. Created a Link Template that used column "KEYCOL" as the Key Column, and all columns as value columns
6. Dropped a Block on the model space and selected the block
7. Selected the third record in the table and selected Create Link
8. When I viewed the custom properties of the block, I found a new property TCDBLinkData. Great! However, I noticed the link *always* points to the first record in the database.

Property: TCDBLink Data
Value: LightLink;KEYCOL4="200";|*|  <===The first record

10. When I synced, as expected, custom properties for the block was updated with information from the first record.
11. If I manually change the Key column value in the TCDBLinkData to the value in the desired column, then the correct data is synced.

I have tried creating connection to the DB using multiple methods (File DSN, System DSN), but the result is the same. I can read and edit the tables, but can only update the block with information from the first record.

This seems to be really straightforward stuff, and I am sure I am missing something simple.  Could someone please point me in the right direction?

Thank you,

Kate---
TurboCAD Professional Platinum V19.1 X64

Kate---

TurboCAD Professional V19.1 x64

nikkipollard

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

W359

Hi Nikki,

I was afraid that might be the case.

Are there any there any alternative methods to keep external repositories in sync with drawing objects? Or must one choose either to work manually in TC with custom properties/reports and export out of TC or externally with databases/spreadsheets and import reports into TC? I would be very interested in how you accomplish this, Nikki.

I took a look at some of the VB code in other parts of the forum and saw that a round trip (Excel to TC and TC to Excel) can be made. I was hoping that TC had this functionality built-in and that the functionality worked.

Thank you,

Kate
Kate---

TurboCAD Professional V19.1 x64

nikkipollard

I find the database connect palette system fiddly and dont use it often.
If I need to change linked data I select the items delete the link and then relink the edited data and sync it.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: nikkipollard on September 03, 2012, 06:09:19 PM
I find the database connect palette system fiddly and dont use it often.
If I need to change linked data I select the items delete the link and then relink the edited data and sync it.

"Fiddly".  49 years old, and that's the first time I came across that word.  Fiddly.

Funny little word.  I looked it up; I like it and will add it to my database.

Thanks for the word of the day, Nikki.  -Alvin
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

W359

"Fiddly". I learned that word while living outside the USA. I like it, 'cause it sounds like what it means!

Kate
Kate---

TurboCAD Professional V19.1 x64

W359

ADDITIONAL: I reported this behavior in a trouble ticket to IMSI. I feel this would be a beneficial feature for folks building BoMs and schedules. They had this working in an earlier version of the product, as I saw this demonstrated in a video.

Kate---
Kate---

TurboCAD Professional V19.1 x64

nikkipollard

Kate I think my problem with the database palette is that I dont understand database systems.
I have tc 18. and have got it to work now.
Forgive me if this doesnt work for you but here is my method.

I use microsoft access files saved to access 2000
I add the data source using microsoft Jet 4.0 ole

Where I was going wrong was where I linked the template file
Your first column is your key column that is the only column you should tick under key. You should also never edit this column in the table as it is a reference. - I did get a warning to this effect.
In your value column tick everything except the first column (because thats the reference column)

I see that what you described in your first post is similar but maybe this helps

I am interested to see how you create a Bim system using this method
It seems to work backwards when you compare it to BIM software.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Dean

I find,The database connect function does work. The problems arise when you come across what you can’t do with it, ruling out bugs of course :). Trial/error are your best friends. I use pre-defined database reports that I created then exported as mdb files from within turbocad. They work great and saves a lot of time. In the database connect palette If I change a field in the loaded table I need to delete selected link then re-link>synchronize data to an object, works as it should.  The data is loaded in the custom field of a linked object in alphabetical order. I can change this when I create a database report by just moving up or down the custom linked fields in the edit menu of the database report then insert the report in the drawing.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

W359

Nikki and Dean,

I feel like I am a bit of a thicko with this. Please let me try your patience with what I am doing to create the link.  Hopefully, this will identify when I am stumbling. I mean, the functionality works in your version of the application.

My database is Access, V 2010 and am using the Office V12 OLEDB Provider in the connection.

My simple table consists of three columns and a Primary Key column.

I know that my DSN works because I can read this table in TC. I cannot, however update table data from TC, but reading should be good enough as I want to pull data from the table.

I created a Link Template that uses the table's Primary Key column in the Key Column dialog and selected the remaining table columns in the Value Columns dialog. (What Nikki recommended -- and thank you for that.)

I dropped a block in the model space.

I selected the block, selected the table name in the Database Connect palette, and selected the Link Template.

I then selected the row I want in the lower pane of Database Connect Palette, and then selected Create Link.

After I selected Synchronize Data, I find that the block has been updated with the values in the first record of the table. (I selected row 5.)

If I change the key column value in the TCDBLinkData attribute and then select Sync Data, I get the correct data from the Access table. 

And that's after lots and lots of trial and error.

I am wondering if this is a symptom of the version of TC I am using (V 19 Professional)????

Thank you very much for your responses. This stuff is not critical, but I would really like to get it to work (if it does work in V19).

I just know it is going to be something really silly that I am missing.

Kate---
Kate---

TurboCAD Professional V19.1 x64

Alvin Gregorio

Kate, I'm just a carpenter, but I enjoy digging for answers and solutions (kind of an OCD attribute, I'm afraid).  Maybe you should post the database file that you are trying to use so that those that are trying to help figure this out are sharing the same reference file.  At the least, they can see if they can get it to function correctly.

-Alvin
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

So it is not recognising that you are pointing to the fifth row? Is there a black arrow highlighting that you are pointing to the fifth row?(stupid question I know)
I have tested 18 using Jet 4 ole,
microsoft office 12.0 access
and the microsoft odbc driver (default)
They all work.
Perhaps this is a 64 bit problem. I see (from googling) that some of these drivers dont work direcly in Autocad 64 bit

Also note (As Dean said) if you change your mind and you want to change a reference from one row to another you need to remove the link and then add the new link or change it as you did via the custom properties.

Dean I havent managed to get regenerate to work, does this work?
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: nikkipollard on September 06, 2012, 12:29:05 AM
So it is not recognising that you are pointing to the fifth row? Is there a black arrow highlighting that you are pointing to the fifth row?(stupid question I know)
I have tested 18 using Jet 4 ole,
microsoft office 12.0 access
and the microsoft odbc driver (default)
They all work.
Perhaps this is a 64 bit problem. I see (from googling) that some of these drivers dont work direcly in Autocad 64 bit

Also note (As Dean said) if you change your mind and you want to change a reference from one row to another you need to remove the link and then add the new link or change it as you did via the custom properties.

Dean I havent managed to get regenerate to work, does this work?

re:  "Perhaps this is a 64 bit problem.":

That's what I was suspecting could be the issue.  What I have gleaned from spending some time on the Forum the past few weeks, TurboCad ver. 19.1 64-bit has a number of specific issues/bugs that the 32-bit version does not necessarily have.

Maybe you'd like to try, Kate, installing and using the 32-bit version of the latest TurboCAD Pro Platinum.  From what I'm reading on the Forum- Posts from recent days/weeks as well as "older" Posts- the 64-bit version does not really do a good job at fully utilizing the available resources and benefits of a 64-bit system.  I'm also reading that the TurboCAD 19.1 32-bit version functions in a 64-bit system.  Other Users have seemed to made the switch, no problem, and seem to be having some positive results. (You like to "test" things, Kate.  Just think of using the 32-bit version and trying to connect to, sync, and use Databases may actually work as you had hoped in the 32-bit version as a "test".)

The other possibility- as nikki pointed out- is the Provider you are using.  That would make sense; have you tried using different Providers, Kate.

-Alvin
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

W359

Hi Alvin and Nikki,

I do see the black arrow in the left-hand column when attempting to connect to a specific record.  But still, TC will only return data from the first record in the table. >:-\

I agree. A little more testing of the OLEDB provider is necessary to eliminate that being an issue. I will write a bit of code and connect directly to MS-Access using the Office V12 Access OLEDB provider.  This way I can capture any error codes that might be returned that I would not see connecting via TC. I will get this code written this morning and report back the results.

Thank you all again for your support on this effort.

Kate---
Kate---

TurboCAD Professional V19.1 x64

Dean

Kate,
1) Did you check the appropriate key columns and value columns when you created the link template?
2) Are the define fields checked as visible and editable in the define fields dialog?
To eliminate any possible bugs with your current provider try creating a turbocad mdb file and using that with the Microsoft 4.0 jet OLE DB provider, it should be within the current list .Off the record, use the version 19-32 bit. That's what I use and I am a lot  ;)happier, now!

Nikki, The regenerate function works.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

W359

Hello All!

I spend quite a bit of time on experimenting with code to connect to an Access database. What I found boils down to the nuances between TC V19 x64, Windows 7 X64, and MS-Access x64.  When connecting between two Office 2010 x64 applications using VBA (Excel <--> Access), I had no trouble synchronizing data. (In other words, the data access drivers on my machine work in certain cases.)

<rant></rant>

Dean, to answer your questions:
1. I checked that I ticked the correct columns several times.
2. I confirmed that all defined fields were defined as visible and editable. (Thank you for the reminder!)
3. Microsoft 4.0 Jet OLE provider is not compatible with Win 7 X64. Or at least that I found on the MS web site.

And now I have a question for you: Are you running TC x32 on a Win 7 x64 operating system? If so, I am downgrading tomorrow!!

Onwards!! And thank you.

Kate---


Kate---

TurboCAD Professional V19.1 x64

Dean

"And now I have a question for you: Are you running TC x32 on a Win 7 x64 operating system?"

Yup!  ;)
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

W359

Hello Alvin, Nikki, and Dean,

I installed TC V19 Professional x32 this weekend and tried to connect to my test Access database.  It worked successfully the very first time.
So, the problem *IS* with the X64 version of TC.

Until someone finds a work-around, if one wants to use the database connectivity features of TC V19 to update custom block attributes, then one needs to use the x32 version of the product.

Thought you might want to know.

Kate---
Kate---

TurboCAD Professional V19.1 x64

Alvin Gregorio

Quote from: W359 on September 09, 2012, 11:56:06 AM
Hello Alvin, Nikki, and Dean,

I installed TC V19 Professional x32 this weekend and tried to connect to my test Access database.  It worked successfully the very first time.
So, the problem *IS* with the X64 version of TC.

Until someone finds a work-around, if one wants to use the database connectivity features of TC V19 to update custom block attributes, then one needs to use the x32 version of the product.

Thought you might want to know.

Kate---

Good to read, Kate.  Did you install the new- 43.2 buid of the x32-bit version?  Perhaps, the new 43.2 build of the x64-bit has "fixed" the issue you were experiencing as well*.  Perhaps.  Be interesting to see.

*(I think I saw a Sync Block attribute in the list of fixes that John R posted in another Topic earlier today). 

-Alvin
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

W359

Hi Alvin,

Just as a test, I took the x32 version of V19.1 right of the disc I was sent (Build 20.4), and the database sync worked like a champ from that version/build. I also tried to sync from Build 43.2 build of the 64 bit version, but still no luck.  I have tried out some other functionality I was having issues with in the x64 version, and they work successfully in the 32-bit version.  I think I shall stay right here (x32) for a bit.

Thank you Nikki and Dean, and Alvin (BIG thanks to Alvin), for all your help. I appreciate it!

Kate---
Kate---

TurboCAD Professional V19.1 x64

nikkipollard

Thanks Kate, Now that I have this working I have discovered that the database connect pallette will also update block attributes. This will save me so much time.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

CliftonPrice

could someone tell me if there any detailed information tutorials about turbocad database connections. thanks.