Hiya Fans!
I hit a brick wall. I was attempting to make a DSNLess connection I seemed to have Goofed somewhere: -
Private Sub SQLServer_Click()
-
Dim MyWorkspace As DAO.Workspace
-
Set MyWorkspace = CreateWorkspace("", "admin", "", dbUseODBC)
-
Dim MyConnection As DAO.Connection
-
Set MyConnection = MyWorkspace.OpenConnection("", , , "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.OpenRecordset(MSSQL)
-
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("EmailAddress")
-
Text1(1).Text = rec_set.fields("IPAddress")
-
Text1(2).Text = rec_set.fields("DateTimeStamp")
-
Text1(3).Text = rec_set.fields("EmailID")
-
rec_set.MoveNext
-
Loop
-
MyWorkspace.Close
-
rec_set.Close
-
-
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
8 4237
To be honest, Dököll, I think msquared, NeoPa and the other gurus in the Access forum are likely to be more helpful on this one.
Hi Dököll
ODBC Connection string for DAO is something like this ::
"ODBC;DSN=MYODBCNAME;UID=MYNAME;PWD=MYPASSWORD;DBQ =DATABASENAME;"
Not very sure, if you can connect SQL2005 using DAO in VB6..
use ADO, instead of DAO..
Regards
Veena
Hello, Guys!
Funny you mentioned Killer42, got a similar post out there on this and msquared has come to aid, waiting to hear from her on a bit of info I stumbled upon. Thanks for your input. Truth is Veena and msquared are right on target, so thank you also, Veena.
Picked up some books at the library, seem to lead where you're at. Seems to be stearing to ADO instead also. I hope to nail it good with ODBC though:-)
Will tell you what comes out of it...
In a bit guys, thanks!
By the way, Killer42, looks like you got your avatar back. Good!
Dököll
Yeah, I figured I would never find the time to update that radar one so went back to something more interesting.
try the use the following sample code
This is for DSN less connection to Oracle using RDO. -
Dim RS As rdoResultset
-
Dim Cn As rdoConnection
-
Dim En As rdoEnvironment
-
Dim Conn As String
-
-
Private Sub Form_Load()
-
Set En = rdoEnvironments(0)
-
Conn = "UID=SCOTT;PWD=TIGER;" _
-
& "DATABASE=ORCL;" _
-
& "SERVER=ORCL;" _
-
& "DRIVER={ORACLE IN ORADB10G_HOME1};DSN='';"
-
Set Cn = En.OpenConnection(dsName:="", _
-
Prompt:=rdDriverNoPrompt, Connect:=Conn)
-
Set RS = Cn.OpenResultset("SELECT * FROM EMP")
-
Call DISP
-
End Sub
-
This would be helpful : ). Keep up the good work experts!
Rey Sean
This would be helpful : ). Keep up the good work experts!
Rey Sean
Super appreciate it, truly...
Sorry to have been away from this post. I will try your examples. I believe msquared said should be too far from VBA. Will try and see:-)
What outpouring support guys, thanks!!!
Dököll
Sign in to post your reply or Sign up for a free account.
Similar topics
by: shank |
last post by:
I'm trying to setup an Access DSNLess connection on my local computer. The
following string works fine within the Dreamweaver interface. But when I
upload to my server (locally) I get this error....
|
by: Tony Epton |
last post by:
<crossposted to several groups>
Is there any way to create a DSNless connection to SQL server from
access 97 (DAO)
All the samples of connection strings I am finding - all have a
reference to a...
|
by: Danieltbt05 |
last post by:
just installed SQL server 2000 and using my client , i can't locate
the server. I used SQL query analyzer to search but no servers were
found. Error message is as below
Server : Msg17,level...
|
by: MrsBean |
last post by:
I've been working on learning how to use PHP with MS Access, and as
long as I use ODBC, I can make it work. I want to use a DSNless
connection. Everthing I have tried has failed. Can anyone show...
|
by: crbd98 |
last post by:
Hello All,
Some time ago, I implemented a data access layer that included a simple
connectin pool. At the time, I did it all by myself: I created N
connections, each connection associated with...
|
by: Ted |
last post by:
In WSAT, I get the following error when trying to set up my provider:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site...
|
by: fniles |
last post by:
I am using VS2003 and connecting to MS Access database.
When using a connection pooling (every time I open the OLEDBCONNECTION I use
the exact matching connection string),
1. how can I know how...
|
by: matthooper |
last post by:
Hello all,
I have this peice of code that connects to a SQL server without the DSN
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
'Create a new ADO Connection object...
|
by: samadams_2006 |
last post by:
Hello,
I have a problem that I'm hoping someone will be able to help me
resolve.
1) I have a C# Web Site in which I connect to the database: "Install
Microsoft SQL Server 2005 Express...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |