![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
The *.bas file created when saving the dts package to visual basic will go into Access, compile and run without error. The problem is that it does nothing. I've put in break points, changed the file path to ensure an error if one can be generated and nothing. The same thing happened in VB6. I should mention that I did add the DTS references in both cases prior to compiling with success. |
#2
| |||
| |||
|
|
The *.bas file created when saving the dts package to visual basic will go into Access, compile and run without error. The problem is that it does nothing. I've put in break points, changed the file path to ensure an error if one can be generated and nothing. The same thing happened in VB6. I should mention that I did add the DTS references in both cases prior to compiling with success. |
#3
| |||
| |||
|
|
Yes the code actually gets hit. I can set through the code and see it hit each line. goPackage.Execute is not commented out. I've put in the password to connect to SQL Server. Why won't it at least throw an error? When you say it does nothing. Does the code actually get hit? Have you commented the line that says you are to run it now or the line that says save it now? Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com www.konesans.com - for all your consultancy needs |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Darren, I would love to rip off the code and use it, but after looking at the code, it appears to me that the line sPackageName = "MyPackage" implies that there is a package saved within Enterprise manage in the 'folder' local packages...and that sPackageName is supposed to refer to that. I do not have the package there (as far as I know). I have the package in the form of VB script in a sub procedure called "Main"...and that is where I would prefer to keep it for purposes of control via MS Access. Maybe I do not understand this correctly, let me know, if so. Allan Mitchell said I could run the whole package with vb code as opposed to using DTSrun /A, for example. To answer your question, the purpose and only purpose of the package is to import a text file into SQL Server. After it runs, I check the SQL Server table and there are still no records in it. No records=>does nothing...that's how I connect the dots. Because the package throws no errors no matter what garbage I put in the file path I would say that I do not know that no errors occur. What I do know is that the VBA with Access has a "on error goto trap" line that I put in to trap errors, and the 'cursor' never goes to the trap...so the VBA doesn't perceive an error as hit. I suppose your point is that the error occurs on the SQL Server side and VBA doesn't know about it? Where do I go from here? "Darren Green" wrote: How do you know it does nothing? How do you know the package did not error during execution? The default code produces just executes the package. There is no code to check that the package executed successfully. DTS (rightly) does not throws run-time errors all the way up to VB when it fails. You may want to look at some of the methods shown here, and rip off the error checking methods- Execute a package from Visual Basic (VB) (http://www.sqldts.com/default.aspx?208) -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Darren, I put in that code and I got this error: Source: Microsoft Data Transformation Services Flat File Rowset Provider Description: Incomplete file format information - file cannot be opened. What is a Rowset Provider? Is that the record terminator? |
#8
| |||
| |||
|
|
Sounds like something if wrong in that area, or just missing information, maybe a record terminator. |
#9
| |||
| |||
|
|
In message <2541A868-190E-4FE3-8C62-C69AF0916FA4 (AT) microsoft (DOT) com>, TomTait747 <TomTait747 (AT) discussions (DOT) microsoft.com> writes Darren, I put in that code and I got this error: Source: Microsoft Data Transformation Services Flat File Rowset Provider Description: Incomplete file format information - file cannot be opened. What is a Rowset Provider? Is that the record terminator? Flat File Rowset Provider is the text file driver, so that is the error source basically. Sounds like something if wrong in that area, or just missing information, maybe a record terminator. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
![]() |
| Thread Tools | |
| Display Modes | |
| |