I have created my own COM library to hide the connection string details form the end user COM library to hide the connection string details form the end user. Basically, it comes down to attaching references to my .tlb, creating an instance of the COM class and returning an active ADODB.Connection
to by calling cnWrapper.GetConnection
.
I have created my own COM library to hide the connection string details form the end user. Basically, it comes down to attaching references to my .tlb, creating an instance of the COM class and returning an active ADODB.Connection
to by calling cnWrapper.GetConnection
.
I have created my own COM library to hide the connection string details form the end user. Basically, it comes down to attaching references to my .tlb, creating an instance of the COM class and returning an active ADODB.Connection
to by calling cnWrapper.GetConnection
.
Is CreatePart()
function in Module1 a sign of bad encapsulation? Shouldn't it be a part of Part
class? I was debating that for a long time but ended up doing it the way shown above. If I wanted to make this a member of Part
class I would have to make Part
static or have a spare, free-floating instance of Part
hanging around - and I didn't want to do that. If you can think of a better approach I would love to hear about it.
Error handling... I not sure I am doing it correctly. I have been encountering tons of errors before I tied everything up and have had at least 10 different ways to handle different errors. Once I started getting rid of some of the errors and I knew the exact reason an error occurred I assumed (rather safely) that some of them will not happen again I removed extra handlers.
Tested the code in a real life situation with 2K parts in the PART table and over 30K in the PARTARC. In my case the code built up the collection in about the same time it was printing it to the spreadsheet (30 seconds & 30 seconds) - therefore if there is anything I have missed or could be improved to speed things up a bit I would really appreciate your advices.
Speed, efficiency, general approach etc.. Any tips, improvements are very welcome.
Is the
CreatePart()
function in Module1 a sign of bad encapsulation? Shouldn't it be a part ofPart
class? I was debating that for a long time but ended up doing it the way shown above. If I wanted to make this a member ofPart
class I would have to makePart
static or have a spare, free-floating instance ofPart
hanging around - and I didn't want to do that. If you can think of a better approach I would love to hear about it.Error handling... I not sure I am doing it correctly. I have been encountering tons of errors before I tied everything up and have had at least 10 different ways to handle different errors. Once I started getting rid of some of the errors and I knew the exact reason an error occurred I assumed (rather safely) that some of them will not happen again I removed extra handlers.
Tested the code in a real life situation with 2K parts in the PART table and over 30K in the PARTARC. In my case the code built up the collection in about the same time it was printing it to the spreadsheet (30 seconds & 30 seconds) - therefore if there is anything I have missed or could be improved to speed things up a bit I would really appreciate your advices.
Speed, efficiency, general approach etc.. Any tips, improvements are very welcome.
Is CreatePart()
function in Module1 a sign of bad encapsulation? Shouldn't it be a part of Part
class? I was debating that for a long time but ended up doing it the way shown above. If I wanted to make this a member of Part
class I would have to make Part
static or have a spare, free-floating instance of Part
hanging around - and I didn't want to do that. If you can think of a better approach I would love to hear about it.
Error handling... I not sure I am doing it correctly. I have been encountering tons of errors before I tied everything up and have had at least 10 different ways to handle different errors. Once I started getting rid of some of the errors and I knew the exact reason an error occurred I assumed (rather safely) that some of them will not happen again I removed extra handlers.
Tested the code in a real life situation with 2K parts in the PART table and over 30K in the PARTARC. In my case the code built up the collection in about the same time it was printing it to the spreadsheet (30 seconds & 30 seconds) - therefore if there is anything I have missed or could be improved to speed things up a bit I would really appreciate your advices.
Speed, efficiency, general approach etc.. Any tips, improvements are very welcome.
Is the
CreatePart()
function in Module1 a sign of bad encapsulation? Shouldn't it be a part ofPart
class? I was debating that for a long time but ended up doing it the way shown above. If I wanted to make this a member ofPart
class I would have to makePart
static or have a spare, free-floating instance ofPart
hanging around - and I didn't want to do that. If you can think of a better approach I would love to hear about it.Error handling... I not sure I am doing it correctly. I have been encountering tons of errors before I tied everything up and have had at least 10 different ways to handle different errors. Once I started getting rid of some of the errors and I knew the exact reason an error occurred I assumed (rather safely) that some of them will not happen again I removed extra handlers.
Tested the code in a real life situation with 2K parts in the PART table and over 30K in the PARTARC. In my case the code built up the collection in about the same time it was printing it to the spreadsheet (30 seconds & 30 seconds) - therefore if there is anything I have missed or could be improved to speed things up a bit I would really appreciate your advices.
Speed, efficiency, general approach etc.. Any tips, improvements are very welcome.
- 145.5k
- 22
- 190
- 478
Please notice you don't really have to rebuild the tables in SQL but I shared an SQL Fiddle SQL Fiddle just in case and screenshots1 of what the database looks like. I thought it was going to be easier to explain the story of what I am doing + you can always quickly build your own if you wanted to.
Please notice you don't really have to rebuild the tables in SQL but I shared an SQL Fiddle just in case and screenshots1 of what the database looks like. I thought it was going to be easier to explain the story of what I am doing + you can always quickly build your own if you wanted to.
Please notice you don't really have to rebuild the tables in SQL but I shared an SQL Fiddle just in case and screenshots1 of what the database looks like. I thought it was going to be easier to explain the story of what I am doing + you can always quickly build your own if you wanted to.
- 25.5k
- 7
- 59
- 141