I had previously written a VB.NET application that ran as a PostProcess in DataWatch Automator. The application would simply read in a CSV file that was generated by a DataPump Process, do some formatting and data massaging so it can then be imported in to our financial system (Great Plains).
Since we moved to DataWatch Automator (Version 12.4) my script will not run anymore. Since, DataWatch Automater has practically full access to the .NET platform for programming, we thought it would be easier to move the code from external application in to a PostProcess inside of Automator. The problem i'm having now is that anytime i reference ODBC, OleDB, or the SQL driver (just as a test), i get the following error:
"Compile Error: ErrorCodeDomCompilerError Number:BC30002, Line:63, ErrorText:Type 'OdbcConnection' is not defined."
Here is my code so far (i haven't copied it all over to Automator yet, just doing sections of code at a time):
' Default Imports...
' Imports from the process...
' Global Declarations from the process...
Dim d As Date = Now
Dim mon As Integer = Month(d)
Dim yr As Integer = Year(d)
Dim theDay As Integer = Now.Day
Dim ImportPath As String = "\\fts-datapump-vm\MONARCH\APPS\SCOTIA_VISA_FI\CSVIN\"
Dim ImportFile As String = "VISAEXPORT_FI.csv"
Dim ImportFilePath As String = ImportPath & ImportFile
Dim ExportPath As String = "\\fts-gpmr-vm\GP_IMPORTS\VISA\"
Dim ExportFileName As String = "VISA_IMPORT_FI_"
Dim ExportFilePath As String = ExportPath & ExportFileName
Dim HSTGLCode As String = "2284-00-0"
Dim TotalEntryGLCode As String = "5997-00-0"
'Get Email Settings. Separate emails with comma
Dim EmailTo As String ="firstname.lastname@example.org"
Dim EmailCC As String = "email@example.com"
Dim EmailFrom As String = "firstname.lastname@example.org"
Dim MailServerAddress As String = "XX.XX.XX.28"
Dim EmailSubject As String = "Visa Upload Complete"
Dim a_FusDiv As New ArrayList
Dim a_SplitDiv As New ArrayList
'Declaring various variables that may be declared multiple times throughout the code.
Dim TranType, DivCode, PostMonth, GLCode, Ref, Desc, Qry, FileName, Vendor As String
Dim TranNum As Integer
Dim PostDate As Date
Function PostProcess(Log as JobLog) as Boolean
PostProcess = True
' PostProcess steps from the process...
Dim SumHst, SumAmt, SumNetHST, NetHST, FITotal, HST, iHST As Decimal
Dim Qry2 As String
Dim conn As OdbcConnection
'Dim conn2 As OdbcConnection
'Dim res As OdbcDataReader
'Dim res2 As OdbcDataReader
'Dim cmd As OdbcCommand
'Dim cmd2 As System.Data.Odbc.OdbcCommand
'Dim conn As OleDb.OleDbConnection
Dim s As StreamWriter
Dim fs As FileStream
'=============================END OF CODE FOR NOW=====================
The line that says Dim conn as OdbcConnection always fails. I've tried OleDB as well and get the same error. I have the proper Imports called that i would normally use in Visual Studio to make an ODBC connection. Do anyone have any suggestions? Is there something i'm missing? I can't imagine having .NET functionality and not being able to use a database/text driver to connect to an external data source. Any help would be greatly appreciated!