Dököll 2,364
Recognized Expert Top Contributor
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 4252
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.
QVeen72 1,445
Recognized Expert Top Contributor
Hi Dököll
ODBC Connection string for DAO is something like this ::
"ODBC;DSN=MYODB CNAME;UID=MYNAM E;PWD=MYPASSWOR D;DBQ=DATABASEN AME;"
Not very sure, if you can connect SQL2005 using DAO in VB6..
use ADO, instead of DAO..
Regards
Veena
Dököll 2,364
Recognized Expert Top Contributor
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
Dököll 2,364
Recognized Expert Top Contributor
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. Can anyone lend some
insight?
thanks
Object required: 'oConn'
/Connections/conn.asp, line 2
<%
|
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 DSN.
Many thanks
Tony
|
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 16, state1
SQL server does not exist
or denied access.
|
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 me a
simple example?
MrsBean
|
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 a worker thread that would
execute the db commands. The pool was fixed and all the connections
were created when the db access class was instantiated. The
connections remained opened during the whole execution. If a connection
was not available...
| |
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
Administration tool, use the aspnet_regsql command-line utility to
create and configure the database, and then return to this tool to set
the provider.
On Windows XP Pro, I am using MS Visual Studio 2005, and I am using
the developer's edition of...
|
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 many connection has been used ?
2. If the maximum pool size has been reached, what happens when I call the
method Open to open the connection ? Will I get an error ? MSDN says the
request is queued, but will I get an error in the open method ?
...
|
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
Set cn = New ADODB.Connection
|
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 Edition" via the link on:
http://msdn2.microsoft.com/en-us/express/bb410792.aspx
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |