I am running an Update routine that calls a function. It appears that the
function never executes because I receive:

Must Declare The Scalar Variable @Country.

Code:

Dim newCustomer As New Customer
newCustomer.CustomerID = customer.CustomerID
Me.PutCustomerData(newCustomer)
Try
If Not CustomerDB.UpdateVendor(customer, newCustomer) Then
MessageBox.Show("Another user has updated or deleted
that customer.", _
"Database Error")
Me.DialogResult = Windows.Forms.DialogResult.Retry
Else
customer = newCustomer
Me.DialogResult = Windows.Forms.DialogResult.OK
End If
Catch ex As Exception
MessageBox.Show(ex.Message, ex.GetType.ToString)
End Try

The only time @Country is used is in a Insert function. In the Update
fuction, I use @NewCountry and @OldCountry, so I am not sure why this is
happening.

Please help.

RE: Must delcare the scalar variable by TomNowak

TomNowak
Wed Feb 27 12:39:01 CST 2008

Thanks, I figured it out myself.

"Tom Nowak" wrote:

> I am running an Update routine that calls a function. It appears that the
> function never executes because I receive:
>
> Must Declare The Scalar Variable @Country.
>
> Code:
>
> Dim newCustomer As New Customer
> newCustomer.CustomerID = customer.CustomerID
> Me.PutCustomerData(newCustomer)
> Try
> If Not CustomerDB.UpdateVendor(customer, newCustomer) Then
> MessageBox.Show("Another user has updated or deleted
> that customer.", _
> "Database Error")
> Me.DialogResult = Windows.Forms.DialogResult.Retry
> Else
> customer = newCustomer
> Me.DialogResult = Windows.Forms.DialogResult.OK
> End If
> Catch ex As Exception
> MessageBox.Show(ex.Message, ex.GetType.ToString)
> End Try
>
> The only time @Country is used is in a Insert function. In the Update
> fuction, I use @NewCountry and @OldCountry, so I am not sure why this is
> happening.
>
> Please help.
>
>
>