Friday, March 9, 2012

Script Component: Keyword not supported: ''provider''

Hi,

I have a script component that accesses the database with this codes:

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim cn As SqlConnection

Dim SQLCmd As SqlCommand

Dim dr As SqlDataReader

Dim NextKey As Integer = 0

cn = New SqlConnection(Connections.CONNofficetestdb.ConnectionString.ToString)

cn.Open()

SQLCmd = New SqlCommand("select count(*) from accounttrans", cn)

dr = SQLCmd.ExecuteReader

While dr.Read()

NextKey = NextKey + 1

End While

End Sub

But I encounter a problem once I ran it:

Keyword not supported: 'provider'

How do I resolve this?

thanks a lot.

cherriesh

Since you are using the SQL Server connection object, you should not have a Provider defined in your connection string. You only have to supply the Provider in the connection string when you are using OLEDB.

No comments:

Post a Comment