Here are more connection strings for you,
that show how to use connect to a datasource using OLEDB.
Conn String
And here is the MS-SQL compatible converted code equivalent of your above codeblock.
Function SomeKnockeUpCode() As String
Dim intX As Integer = Nothing
Dim intY As Integer = Nothing
Dim strSting As String = Nothing
Dim strSqlQUery As String = Nothing
Dim cmdSqlCommand As Data.SqlClient.SqlCommand = Nothing
Dim rdrDataReader As Data.SqlClient.SqlDataReader = Nothing
strSqlQUery = "Select TalentID From tbl_talent_database Order by TalentID"
msSqlConnection = New Data.SqlClient.SqlConnection()
msSqlConnection.ConnectionString = CurrentProject.Connection
cmdSqlCommand = New Data.SqlClient.SqlCommand(strSqlQUery, msSqlConnection)
If cmdSqlCommand.Connection.State = Data.ConnectionState.Closed Then cmdSqlCommand.Connection.Open()
rdrDataReader = cmdSqlCommand.ExecuteReader()
If rdrDataReader.HasRows Then
Do While rdrDataReader.Read()
intX = 0
intY = rdrDataReader.GetValue(rdrDataReader.GetOrdinal("TalentID"))
Do While intX <> intY
intX = intX + 1
If intX <> intY Then
strSting = strSting & intX & " "
Else
Exit Do
End If
Loop
Loop
End If
If cmdSqlCommand.Connection.State = Data.ConnectionState.Open Then cmdSqlCommand.Connection.Close()
Return strSting
intX = Nothing
intY = Nothing
strSting = Nothing
strSqlQUery = Nothing
cmdSqlCommand = Nothing
rdrDataReader = Nothing
End Function