473,788 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connection problem from Access front end application to SQL Desktop Engine backend

Hi there,

I sincerely hope that someone out there can help. I have two instances
of the SQL 2000 Desktop Engine running. One is on my local machine for
development and the other is on another machine on our network which is
the production environment. I have built an Access 2003 front end
application which connects to this database. This works fine locally,
as you would expect. I successfully installed the database on the
production machine and am able to connect to it via Access 2003 (using
the Data Link Properties window) and from third party database manager
software (similar to Enterprise Manager). I am not able to to connect
to the database via my application.

I am using the "sa" account with a strong password. This is my
connection string:

strConnection = "Provider=sqlol edb;DataSource= server02;User
Id=sa;Password= strong;Initial Catalog=Test"

The error I'm getting is:

"Connection cannot be used to perform this operation. It is either
closed or invalid in this context."

The connection string is the only thing that changes in my code when I
switch from my local to my production environment. Is there some
reason that I can't use the "sa" account in this fashion that I'm not
aware of? I'd rather not use integrated security for simplicity's sake
as this is a small, internal application. Also, I would have thought
that if that was the issue, I couldn't use "sa" at all, even locally.

I have posted to the SQL Server group already but thought someone here
might have some advice to offer.

Thanks,

Barb

Nov 13 '05 #1
9 1490
PROVIDER=SQLOLE DB.1;INTEGRATED SECURITY=SSPI;P ERSIST SECURITY
INFO=FALSE;INIT IAL CATALOG=TEST;DA TA SOURCE=SERVERNA ME

Also try signing in with a valid Windows user account that is a member
of a role or group on the server.

Nov 13 '05 #2
PROVIDER=SQLOLE DB.1;INTEGRATED SECURITY=SSPI;P ERSIST SECURITY
INFO=FALSE;INIT IAL CATALOG=TEST;DA TA SOURCE=SERVERNA ME

Also try signing in with a valid Windows user account that is a member
of a role or group on the server.

Nov 13 '05 #3
Hi there,

Thanks for the advice. Can I assume from your response that it's not
possible to use the "sa" account in this fashion? As I had mentioned,
I'd prefer to not use integrated security if possible. Since I can
access the SQL server with the "sa" account in all instances except
from the application to the server, I wouldn't think that was the
problem but if someone could confirm that's definitely the case, I'd be
grateful.

Barb
lauren quantrell wrote:
PROVIDER=SQLOLE DB.1;INTEGRATED SECURITY=SSPI;P ERSIST SECURITY
INFO=FALSE;INIT IAL CATALOG=TEST;DA TA SOURCE=SERVERNA ME

Also try signing in with a valid Windows user account that is a member of a role or group on the server.


Nov 13 '05 #4
Barb,

Can you post the code that you're using to make the connection? Show
us the code that works and the code that doesn't.

Bill E.

Nov 13 '05 #5
Hi Bill,

The connection string is exactly the same as the line that I originally
posted with the exception of the data source parameter. Here's the
code for the sub in question as you requested. The development
connection string is commented out here because I'm trying to connect
to the production database. The only change that would happen in my
code if I was working with the dev database is that I'd comment out the
production connection string and comment in the dev connection string.
When trying to connect to the production database I error on
cnConn.Open strConnection. The error I'm actually getting is "Invalid
connection string attribute" (-2147217843).

Hope this is enough information and thanks to everyone for their help
so far.

Barb

Sub OpenDbConnectio n()
On Error GoTo HandleError

'dev connection string
'strConnection = "Provider=sqlol edb;DataSource= local;User
Id=sa;Password= br8111;" & _
"Initial Catalog=Subscri berMngt"

'production connection string
strConnection = "Provider=sqlol edb;DataSource= server02;User
Id=sa;Password= qr7959;" & _
"Initial Catalog=Subscri berMngt"

'create new connection instance and open it using the connection
string
Set cnConn = New ADODB.Connectio n
cnConn.Open strConnection

Exit Sub

HandleError:
GeneralErrorHan dler Err.Number, Err.Description , DB_LOGIC, _
"OpenDbConnecti on"
End Sub
billmia...@nets cape.net wrote:
Barb,

Can you post the code that you're using to make the connection? Show
us the code that works and the code that doesn't.

Bill E.


Nov 13 '05 #6
I'm not sure that my post went through, so I'll repeat myself.

Some thoughts:

*Can you try adding a semicolon at the end of the string as in

strConnection = "Provider=sqlol edb;DataSource= server02;User
Id=sa;Password= qr7959;Initial Catalog=Subscri berMngt;"

*Are you sure that qr7959 has no capitalization? Have you tried QR7959
or Qr7959 instead?

*Can you ping server02? Can you ping its IP address? Have you tried
replacing server02 with the IP address?

Bill

Nov 13 '05 #7
I suppose one thing is that you're not terminating your connection
string with a semicolon. I'm not sure if it's necessary, but can you
try changing

"Initial Catalog=Subscri berMngt"

to

"Initial Catalog=Subscri berMngt;"

Lastly, I'm not sure if there is case sensitivity with passwords, but
have you tried different variations of br8111 as in BR8111 or Br8111?

Bill

Nov 13 '05 #8
Hi there,

Thanks for the suggestions but no luck :-(. I'm going to try using a
different account i.e. not the "sa" account but would appreciate a post
if anyone out there knows why the "sa" account wouldn't work in this
instance. If I get the same problem with a Windows account, I'll know
that it's not an account issue but perhaps a permissions issue? It
shouldn't have to be so complicated ...

Thanks again,

Barb

billmia...@nets cape.net wrote:
I suppose one thing is that you're not terminating your connection
string with a semicolon. I'm not sure if it's necessary, but can you
try changing

"Initial Catalog=Subscri berMngt"

to

"Initial Catalog=Subscri berMngt;"

Lastly, I'm not sure if there is case sensitivity with passwords, but
have you tried different variations of br8111 as in BR8111 or Br8111?

Bill


Nov 13 '05 #9
Hi again,

I just wanted to let everyone know that I finally got it to work by
using integrated security. I know that this is the recommended method
but I'd still be curious to know if anyone had any further thoughts on
why it didn't work with "sa".

Barb

Barb wrote:
Hi there,

Thanks for the suggestions but no luck :-(. I'm going to try using a
different account i.e. not the "sa" account but would appreciate a post if anyone out there knows why the "sa" account wouldn't work in this
instance. If I get the same problem with a Windows account, I'll know that it's not an account issue but perhaps a permissions issue? It
shouldn't have to be so complicated ...

Thanks again,

Barb

billmia...@nets cape.net wrote:
I suppose one thing is that you're not terminating your connection
string with a semicolon. I'm not sure if it's necessary, but can you try changing

"Initial Catalog=Subscri berMngt"

to

"Initial Catalog=Subscri berMngt;"

Lastly, I'm not sure if there is case sensitivity with passwords, but have you tried different variations of br8111 as in BR8111 or Br8111?
Bill


Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4242
by: Barb | last post by:
Hi there, I sincerely hope that someone out there can help. I have two instances of the SQL 2000 Desktop Engine running. One is on my local machine for development and the other is on another machine on our network which is the production environment. I have built an Access 2003 front end application which connects to this database. This works fine locally, as you would expect. I successfully installed the database on the...
8
4718
by: Uttam | last post by:
Hello, I am currently in the process of developing an application in a pure desktop world using Access 2000. I am intending to convert this pure desktop application into a Client Server application with Access 2000 as the front end and the each of the following as the backend: 1) Oracle
5
1743
by: MLH | last post by:
I have little or no knowledge as to how a runtime Access database application might be distributed from a website. I am sure that I'm about to find out. I do have one question for you wizards though... My experience has shown that when I have installed applications from the web, my browser generally asks what I want to do with the file... Do I wanna save it? or Do I wanna run it? The browser generally warns about the dangers of executing...
4
2315
by: (Pete Cresswell) | last post by:
I would argue that it is not. JET is a desktop DB engine. Sybase is a database Oracle is a database DB2 is a database. VB 6 is a front-end development tool. PowerBuilder is a front-end development tool. MS Access is a front end devlopment tool.
6
2264
by: alanknipmeyer | last post by:
Hi, I`m in the process of migrating a Access 2002 (Run in 2000 mode) from Windows 98 to Win2K Server. It is a shared resource via a file share on the 98 Server. Client systems are Win98 with the shared drive mounted and the application run via the shared drive. I have tried once before, but came across some file locking issues. I thought i had addressed these file locking issues, but it came apparent I hadn't when data started to get...
35
3227
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 = 2,048,000k Let's say on average each record in the database consumes 15k 2,048,000/15 = 136,533 records
6
1688
by: jonefer | last post by:
I have two versions of a 'Downtime Application that will run in the event that the mainframe goes down 1) SQL Server ASP.NET app (accessed outside the mainframe network) 2) MS Access Version of the same app locally installed (C Drive) Can someone help me with the 'Catch' part of this code in VB.NET? Pseudo code
37
5245
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why would you even continue to use Access as a backend when you have a much superior option in SQL express? What about as a future front-end development tool? Let's get serious. Microsoft continues to publish numerous articles and videos on how you...
16
13618
by: Brian D | last post by:
I have a multiple select list that is created dynamically based on a previous selection on an asp page. The first thing I do is to clear the curent option list by document.form1.itemcross.length = 0; The only problem is that it leaves the optgroups. How do I also get rid of the optgroups? Thanks
1
1715
by: rlntemp-gng | last post by:
I have two .mdbs, MyTestApp.mdb- front end for forms and MyTestData.mdb-backend for tables. While the front end is copied to the user's desktop via a batch file, the front end is linked to the backend currently. I did that manually. The catch here is that the backend .mdb is used by more than one application. I am looking for a way via VBA in my front end app at startup (and the
0
9498
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,...
0
10366
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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,...
1
7517
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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();...
0
5399
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...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.