Hiya Fans!
I hit a brick wall. I was attempting to make a DSNLess connection I seemed to have Goofed somewhere:
[CODE=VB]
Private Sub SQLServer_Click ()
Dim MyWorkspace As DAO.Workspace
Set MyWorkspace = CreateWorkspace ("", "admin", "", dbUseODBC)
Dim MyConnection As DAO.Connection
Set MyConnection = MyWorkspace.Ope nConnection("", , , "ODBC;DATABASE= FirstSQLDB")
Dim rec_set As DAO.Recordset
Dim MSSQL As String
MSSQL = "SELECT * FROM Email WHERE EmailAddress ='" & Text1(0).Text & "'"""
Set rec_set = MyWorkspace.Ope nRecordset(MSSQ L)
Do While Not rec_set.EOF 'this function will keep searching for fields matching each textbox
'MsgBox ("got here")
Text1(0).Text = rec_set.fields( "EmailAddre ss")
Text1(1).Text = rec_set.fields( "IPAddress" )
Text1(2).Text = rec_set.fields( "DateTimeStamp" )
Text1(3).Text = rec_set.fields( "EmailID")
rec_set.MoveNex t
Loop
MyWorkspace.Clo se
rec_set.Close
[/CODE]
Trying to grab data out of SQL Server database using DAO with ODBC connection, new to ODBC, have made one fancy connection in the past, forgot it all.
I get a pop up requesting I add DSN name or other...
What do you see?
In a bit!
Dököll
I hit a brick wall. I was attempting to make a DSNLess connection I seemed to have Goofed somewhere:
[CODE=VB]
Private Sub SQLServer_Click ()
Dim MyWorkspace As DAO.Workspace
Set MyWorkspace = CreateWorkspace ("", "admin", "", dbUseODBC)
Dim MyConnection As DAO.Connection
Set MyConnection = MyWorkspace.Ope nConnection("", , , "ODBC;DATABASE= FirstSQLDB")
Dim rec_set As DAO.Recordset
Dim MSSQL As String
MSSQL = "SELECT * FROM Email WHERE EmailAddress ='" & Text1(0).Text & "'"""
Set rec_set = MyWorkspace.Ope nRecordset(MSSQ L)
Do While Not rec_set.EOF 'this function will keep searching for fields matching each textbox
'MsgBox ("got here")
Text1(0).Text = rec_set.fields( "EmailAddre ss")
Text1(1).Text = rec_set.fields( "IPAddress" )
Text1(2).Text = rec_set.fields( "DateTimeStamp" )
Text1(3).Text = rec_set.fields( "EmailID")
rec_set.MoveNex t
Loop
MyWorkspace.Clo se
rec_set.Close
[/CODE]
Trying to grab data out of SQL Server database using DAO with ODBC connection, new to ODBC, have made one fancy connection in the past, forgot it all.
I get a pop up requesting I add DSN name or other...
What do you see?
In a bit!
Dököll
Comment