SQL Connections & Record Select
I am trying to convert a vbscript over to .net 2005 , i have sorted out the connection part but what i am having problems with is the
db.Execute which gives me an error of Execute is not a member of the 'system.data.odbc.odbcconnection'
And rs.eof which gives me an error of Option Strict on disallows late binding
Has anyone got any ideas? please note i am very new to vb
Private Sub CheckiManageInitialsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckiManageInitialsButton.Click
Dim strImanage As String
Dim db As New Odbc.OdbcConnection
Dim rs As Object
strImanage = iManageInitialsTextBox.Text
'==============================
'This is the UK iManage Server
'==============================
Dim myConnString As String = _
"Provider=SQLOLEDB.1;Password=PASSWORD HERE;Persist Security Info=True;User ID=USER ID HERE;Initial Catalog=Imdbprecedent;Data Source=IP ADDRESS HERE"
Dim myConnection As New Odbc.OdbcConnection(myConnString)
myConnection.Open()
rs = CreateObject("ADODB.recordset")
rs = db.Execute("select userid from mhgroup.docusers where userid = '" & strImanage & "'")
If Not rs.eof Then
MsgBox("UserName: " & strImanage & " is NOT available in the UK iManage system" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Please do not use this User ID as its in use", 64, "Alert - PLEASE READ , PLEASE READ")
Else
MsgBox("UserName: " & strImanage & " is available in the UK iManage system", 64, "Alert - PLEASE READ , PLEASE READ")
End If
myConnection.Close()
End Sub

