Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Strange VB error when running the same script in VS2005 and VS2008

$
0
0

Apologies if this is not the correct forum for posting this particular query, but I'm still not sure if it's a Visual studio 2005 issue or a quirk with the  DotConenct driver that I'm using to dynamically construct and run a select query against a MySQL database.

I am using VB script within an SSIS script object to dynamically construct a select query on a MySQL database - based on input variables to construct the date range - using the DotConnect for MySQL .Net provider.

I'm editing a pre-existing and correctly running script to add in a column in the extract query - nothing extraordinary.

I have a copy of the same SSIS package in both a VS2005 and vs2008 solution files.

When I open the script in 2005 and try to add the column I get three specific errors pertaining to Types not defined for MySqlConnection, MySqlCommand and MySqlParameter.

The relevant header code is as follows (I've omitted the dynamic SQL string):
Option Strict Off
Imports System
Imports Devart.Data
Imports Devart.Data.MySql
Imports System.Math
Imports System.IO
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.Text.RegularExpressions

Public Class ScriptMain
Inherits UserComponent

Dim MySqlConn As MySqlConnection
Dim MySqlCmd As MySqlCommand
Dim MySqlParam As MySqlParameter

Public Overrides Sub AcquireConnections(ByVal Transaction As Object)

MySqlConn = Me.Connections.Connection.AcquireConnection(Nothing)
MySqlConn.Open()

End Sub
(I've omitted the dynamic SQL string and return code that would normally be here)

When I open the code in VS2008 and add the column I get no such validation errors and the script runs without issue:

For reference that code is:

Option Strict Off
Imports System
Imports Devart.Data
Imports Devart.Data.MySql
Imports System.Math
Imports System.IO
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.Text.RegularExpressions

<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute> _
<CLSCompliant(False)> _
Public Class ScriptMain
Inherits UserComponent

Dim MySqlConn As MySqlConnection
Dim MySqlCmd As MySqlCommand
Dim MySqlParam As MySqlParameter

Public Overrides Sub AcquireConnections(ByVal Transaction As Object)

MySqlConn = Me.Connections.Connection.AcquireConnection(Nothing)
MySqlConn.Open()

End Sub

So I'm not sure whay the same script fails validation in VS2005 but runs in VS2008, and am not sure if it's a VS bug or a known quirk with the dotConnect for MySQL VS2005 driver? Any assistance or thoughts greatly appreciated.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>