473,586 Members | 2,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with simple login form

Hi all,

I have been working with this since last night, and can't quite figure out
why it's not working. I have a simple login box form that is set to be my
startup form in my Access app (upon successful authentication, it opens the
Switchboard). All it does is get the username and password, pull up a
recordeset of the usernames and sets the UserId to be used throughout the
session. The table Userlist is a SQL 2000 linked table. I can open this
table from the app with no trouble.
Here's the code:

'Begin snipped code*********** *******

Private Sub cmdLogin_Click( )

Dim dbs As Database
Dim rst As Recordset
Dim strSQL As String

strUsername = (Trim(txtUser.V alue))
strPass = (Trim(txtPass.V alue))
Set dbs = CurrentDb

strSQL = "SELECT UserID, Username, RoleID " _
& "FROM Userlist " _
& "WHERE ((Username= '" & strUsername & "' ) and (Password = '" &
strPass & "'))"

Set rst = dbs.OpenRecords et(strSQL) <-----point of failure

'End snipped code*********** *************** *************** **

The error message is :

SQLState :'01000'
SQL Server Error : 10060
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]
ConnectionOpen [Connect()],
Connection failed ;
SQLState :'08001'
SQL Server Error : 17
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL
server does not exist or access denied.

And THEN - it tries to get me to log into SQL Server (doesn't specify which
one). If I actually attempt to login, with the sa password, it still fails.
I have successfully used this code in other parts of the project, so it must
have something to do with the DB state upon opening, n'est ce-pas?

Any clues, anyone :)???

TIA,

Carrie Hamm


Nov 12 '05 #1
5 2628
Hello,

normally the login-box of the SQL-Server comes up
when there is no successful login from the Project or
ODBC-Connection possible or the specified server does
not exist.
Chck your connection to the SQL-Server and update
the linkinformation of the linked table

HTH
Karpi
<fluctuat nec mergitur>

Am Mon, 05 Apr 2004 13:51:31 -0600 schrieb calaha:
Hi all,

The error message is :

SQLState :'01000'
SQL Server Error : 10060
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]
ConnectionOpen [Connect()],
Connection failed ;
SQLState :'08001'
SQL Server Error : 17
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL
server does not exist or access denied.

And THEN - it tries to get me to log into SQL Server (doesn't specify which
one). If I actually attempt to login, with the sa password, it still fails.
I have successfully used this code in other parts of the project, so it must
have something to do with the DB state upon opening, n'est ce-pas?

Any clues, anyone :)???

TIA,

Carrie Hamm


Nov 12 '05 #2
> "The table Userlist is a SQL 2000 linked table."

Set dbs = CurrentDb

The error message is :

SQLState :'01000'
SQL Server Error : 10060
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]
ConnectionOpen [Connect()],
Connection failed ;
SQLState :'08001'
SQL Server Error : 17
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL
server does not exist or access denied.


I am a newbie to access VBA but. . .

Have you tried to use the DSN connection parameters instead of just
the Current DB? I think they are like
DSN="YourDSNNam e",UID="UserIDo fODBCDatabase", PWD="Password" etc.

Just a thought, good luck!

Brandon R.
Nov 12 '05 #3
Hi there,

Thanks for the replies, everyone. I have tried running linked table manager
and the links are working in all of my other code. I also found that this
form doesn't work even if I have been using the app for a while and then try
to use the login form again, so it's not a startup issue like I thought. I
have tried to avoid hardcoding the username and password for maintenance
purposes. I even tried rebuilding this form from scratch and renaming it
with no success. I am thoroughly stumped...
"calaha" <ca********@kno spamlogy.net> wrote in message
news:10******** ****@corp.super news.com...
Hi all,

I have been working with this since last night, and can't quite figure out
why it's not working. I have a simple login box form that is set to be my
startup form in my Access app (upon successful authentication, it opens the Switchboard). All it does is get the username and password, pull up a
recordeset of the usernames and sets the UserId to be used throughout the
session. The table Userlist is a SQL 2000 linked table. I can open this
table from the app with no trouble.
Here's the code:

'Begin snipped code*********** *******

Private Sub cmdLogin_Click( )

Dim dbs As Database
Dim rst As Recordset
Dim strSQL As String

strUsername = (Trim(txtUser.V alue))
strPass = (Trim(txtPass.V alue))
Set dbs = CurrentDb

strSQL = "SELECT UserID, Username, RoleID " _
& "FROM Userlist " _
& "WHERE ((Username= '" & strUsername & "' ) and (Password = '" &
strPass & "'))"

Set rst = dbs.OpenRecords et(strSQL) <-----point of failure

'End snipped code*********** *************** *************** **

The error message is :

SQLState :'01000'
SQL Server Error : 10060
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]
ConnectionOpen [Connect()],
Connection failed ;
SQLState :'08001'
SQL Server Error : 17
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL
server does not exist or access denied.

And THEN - it tries to get me to log into SQL Server (doesn't specify which one). If I actually attempt to login, with the sa password, it still fails. I have successfully used this code in other parts of the project, so it must have something to do with the DB state upon opening, n'est ce-pas?

Any clues, anyone :)???

TIA,

Carrie Hamm

Nov 12 '05 #4
If you really want a security scheme that works then you should use
the built in security scheme that Microsoft provides. It's kind of
tricky to get set up, but once it is it works REALLY WELL.

If you're interested in this just email me and let me know. I'll
scrounge up the instructions for it for you and post them.

Just a thought,
T

"calaha" <ca********@kno spamlogy.net> wrote in message news:<10******* ******@corp.sup ernews.com>...
Hi there,

Thanks for the replies, everyone. I have tried running linked table manager
and the links are working in all of my other code. I also found that this
form doesn't work even if I have been using the app for a while and then try
to use the login form again, so it's not a startup issue like I thought. I
have tried to avoid hardcoding the username and password for maintenance
purposes. I even tried rebuilding this form from scratch and renaming it
with no success. I am thoroughly stumped...
"calaha" <ca********@kno spamlogy.net> wrote in message
news:10******** ****@corp.super news.com...
Hi all,

I have been working with this since last night, and can't quite figure out
why it's not working. I have a simple login box form that is set to be my
startup form in my Access app (upon successful authentication, it opens

the
Switchboard). All it does is get the username and password, pull up a
recordeset of the usernames and sets the UserId to be used throughout the
session. The table Userlist is a SQL 2000 linked table. I can open this
table from the app with no trouble.
Here's the code:

'Begin snipped code*********** *******

Private Sub cmdLogin_Click( )

Dim dbs As Database
Dim rst As Recordset
Dim strSQL As String

strUsername = (Trim(txtUser.V alue))
strPass = (Trim(txtPass.V alue))
Set dbs = CurrentDb

strSQL = "SELECT UserID, Username, RoleID " _
& "FROM Userlist " _
& "WHERE ((Username= '" & strUsername & "' ) and (Password = '" &
strPass & "'))"

Set rst = dbs.OpenRecords et(strSQL) <-----point of failure

'End snipped code*********** *************** *************** **

The error message is :

SQLState :'01000'
SQL Server Error : 10060
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]
ConnectionOpen [Connect()],
Connection failed ;
SQLState :'08001'
SQL Server Error : 17
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL
server does not exist or access denied.

And THEN - it tries to get me to log into SQL Server (doesn't specify

which
one). If I actually attempt to login, with the sa password, it still

fails.
I have successfully used this code in other parts of the project, so it

must
have something to do with the DB state upon opening, n'est ce-pas?

Any clues, anyone :)???

TIA,

Carrie Hamm

Nov 12 '05 #5
Thanks for the info...If I had more time I would probably try it, but I have
to deliver the app on Friday. I was curious, though, how would that work if
I have to use logins and passwords that were created in another app
(VB/SQL)? Can it be integrated seamlessly, or would we have to create
separate accounts?
<gh*******@hotm ail.com> wrote in message
news:e6******** *************** **@posting.goog le.com...
If you really want a security scheme that works then you should use
the built in security scheme that Microsoft provides. It's kind of
tricky to get set up, but once it is it works REALLY WELL.

If you're interested in this just email me and let me know. I'll
scrounge up the instructions for it for you and post them.

Just a thought,
T

"calaha" <ca********@kno spamlogy.net> wrote in message

news:<10******* ******@corp.sup ernews.com>...
Hi there,

Thanks for the replies, everyone. I have tried running linked table manager and the links are working in all of my other code. I also found that this form doesn't work even if I have been using the app for a while and then try to use the login form again, so it's not a startup issue like I thought. I have tried to avoid hardcoding the username and password for maintenance
purposes. I even tried rebuilding this form from scratch and renaming it with no success. I am thoroughly stumped...
"calaha" <ca********@kno spamlogy.net> wrote in message
news:10******** ****@corp.super news.com...
Hi all,

I have been working with this since last night, and can't quite figure out why it's not working. I have a simple login box form that is set to be my startup form in my Access app (upon successful authentication, it opens
the
Switchboard). All it does is get the username and password, pull up a
recordeset of the usernames and sets the UserId to be used throughout
the session. The table Userlist is a SQL 2000 linked table. I can open this table from the app with no trouble.
Here's the code:

'Begin snipped code*********** *******

Private Sub cmdLogin_Click( )

Dim dbs As Database
Dim rst As Recordset
Dim strSQL As String

strUsername = (Trim(txtUser.V alue))
strPass = (Trim(txtPass.V alue))
Set dbs = CurrentDb

strSQL = "SELECT UserID, Username, RoleID " _
& "FROM Userlist " _
& "WHERE ((Username= '" & strUsername & "' ) and (Password = '" & strPass & "'))"

Set rst = dbs.OpenRecords et(strSQL) <-----point of failure

'End snipped code*********** *************** *************** **

The error message is :

SQLState :'01000'
SQL Server Error : 10060
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]
ConnectionOpen [Connect()],
Connection failed ;
SQLState :'08001'
SQL Server Error : 17
[microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL
server does not exist or access denied.

And THEN - it tries to get me to log into SQL Server (doesn't specify

which
one). If I actually attempt to login, with the sa password, it still

fails.
I have successfully used this code in other parts of the project, so

it must
have something to do with the DB state upon opening, n'est ce-pas?

Any clues, anyone :)???

TIA,

Carrie Hamm

Nov 12 '05 #6

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

Similar topics

2
4437
by: Jon Dellaria | last post by:
I have been using MySql as the database using JSP's and JavaBeans but recently I have wanted to start using the database connection pooling mechanism built into TomCat. I think I am having a problem with defining my JDBC resource within Tomcat. I am pretty sure that my code is correct (but I am not certain), and the problem is with...
0
3479
by: Michael Fork | last post by:
Note: I pasted the code the attachments as plain text after the message (I wasn't able to post it with an attachment...) Attached are the XSL and XML files that I am having problems with. I am trying to extract the stock information after having downloaded the HTML and converted to XML (well-formed HTML) using XSL and XPATH and am unable. ...
5
2256
by: calaha | last post by:
Hi all, I have been working with this since last night, and can't quite figure out why it's not working. I have a simple login box form that is set to be my startup form in my Access app (upon successful authentication, it opens the Switchboard). All it does is get the username and password, pull up a recordeset of the usernames and sets...
0
1114
by: Dam6 | last post by:
Hello, Having a bit of trouble with a simple login page etc using an access db. (Using DW 2004 and databases from Sean R. Nicholson) I've created a virtual application, added the dw ctrls and here is the error when I try to parse my login.aspx page: (Line 56 being the culprit) Any ideas?
14
2385
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a standard ASPX page with minor modifications to it. All of my pages inherit from a "BasePage.cs" class, that handles common things like getting the...
2
1985
by: Gary Coutts | last post by:
Hi, I am have problems redirecting from a login page. The login page is simple, with just 2 textboxes and one button. On the button click the routine below is called: I am using: Visual Studio 2003 Version 7.1.3008 Framework 1.1 Version 1.1.4322 SP1 Windows XP Pro Version 2002 SP2
2
4223
by: Sasquatch | last post by:
I'm having trouble creating a simple login page using the asp:login control. I followed some instructions in a WROX book, "Beginning ASP.NET 2.0," and the instructions are very straight forward, but it won't work for me. Here's what I did. 1. Created a new folder named "testlogin" 2. Turned that folder into an application using the IIS...
2
1620
by: =?Utf-8?B?VG9ueSBHaXJnZW50aQ==?= | last post by:
Hello. Trying to develop ASP.NET Web Application Project using Visual Studio 2005, SP1, Web Application Projects 2005, .NET Framework 2.0.50727.42, ASP.NET 2.0.50727.210, in Visual Basic on a Windows XP Pro, SP2 computer. I developed a lot of it by using the excellent tutorials by Scott Mitchell at...
0
1316
by: kang jia | last post by:
hi i have small problems occurred in my login function, which i use Django to build, in my template which is login.html, the code is like the following: <html> <head> <title>Login</title>
0
7839
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...
0
8200
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. ...
0
8215
tracyyun
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...
1
5710
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...
0
3836
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...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
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...

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.