Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21842

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

$
0
0
I am trying to display oracle DB into DataGrid and facing some problem

Code:

Private Sub Command2_Click()
    Dim oconn As ADOconnect
    Dim rs As Recordset
    Dim strSQL As String
   
    strSQL = "SELECT * FROM ZZZJUNKPERSON"
    Set oconn = New ADOconnect
    Set rs = New ADODB.Recordset
    oconn.Open "ODBC;DSN=SSSS;UID=SSSSS;PWD=SSSSS;DATABASE=SSSSS"
    rs.CursorType = adOpenStatic
    rs.CursorLocation = adUseClient
    rs.LockType = adLockOptimistic
    rs.Open strSQL, oconn, , , adCmdText
    Set DataGrid1.DataSource = rs
       
End Sub

when I compile the code I get error.
I am new to VB.

Viewing all articles
Browse latest Browse all 21842

Trending Articles