ODBC Error in VB.NET after upgrade from VB6

I have recently converted my VB6 app to VB.NET.

When i try to open one of my form,i'm getting the following error

[Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified"

I'm using ADODC control and sheridian datagrid control in this form.

The error happens in the following routines,

Public Sub VB6_AddADODataBinding()
dbgrid1.DataSource = CType(datacontrol1, msdatasrc.DataSource)
End Sub

When i try to close this form,

Public Sub VB6_RemoveADODataBinding()
dbgrid1.DataSource = Nothing
End Sub

I tried all the options by re-installing MDAC, Oracle 9i Client. Do i need to reference anything?
Anybody has any ideas how to get round this? Your thoughts would be very very welcome because I've been struggling with this for some time.

Thanks,
VKT

[859 byte] By [VKT] at [2007-12-16]
# 1

I would suggest looking at the InitializeComponents sub routine and verify that the connection string for the datacontrol1 is still valid. If you're using VB 2005 you'll find InitializeComponents in the designer.vb file for the form. You may have to view all files from the solution explorer to see it. If you're using VB 2003 then it will be in the form's .vb file.

I assume that the original VB6 project still runs on this same machine so this connection string should still work but it's worth looking at since that sounds like the problem to me.

Please let me know if that doesn't solve the problem.

John Hart
Microsof

JohnHart_MS at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

Hi,

I get similar error. But in my situation I use a data control and this uses a disconnected recordset as the source, so the commandType is set to stored proc and the connection string is empty. I use oledb connection for the recordset. And here is my code where it breaks.

Public Sub VB6_AddADODataBinding()

ADOBind_dcCreditStatus = New VB6.MBindingCollection()

grdCreditStatus.DataSource = CType(dcCreditStatus, msdatasrc.DataSource)

ADOBind_dcCreditStatus.DataSource = CType(dcCreditStatus, msdatasrc.DataSource)

ADOBind_dcCreditStatus.Add(txtCreditStatus, "Text", "CreditStatusName", Nothing, "txtCreditStatus")

ADOBind_dcCreditStatus.UpdateMode = VB6.UpdateMode.vbUpdateWhenPropertyChanges

ADOBind_dcCreditStatus.UpdateControls()

End Sub

It breaks on the third line where it sets the DataCource for the datacontrol. Any help would be appreciated.

Thanks,

SS

SSwam at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...