By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Problems with simple login form

P: n/a
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.Value))
strPass = (Trim(txtPass.Value))
Set dbs = CurrentDb

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

Set rst = dbs.OpenRecordset(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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
> "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="YourDSNName",UID="UserIDofODBCDatabase",PWD=" Password" etc.

Just a thought, good luck!

Brandon R.
Nov 12 '05 #3

P: n/a
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********@knospamlogy.net> wrote in message
news:10************@corp.supernews.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.Value))
strPass = (Trim(txtPass.Value))
Set dbs = CurrentDb

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

Set rst = dbs.OpenRecordset(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

P: n/a
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********@knospamlogy.net> wrote in message news:<10*************@corp.supernews.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********@knospamlogy.net> wrote in message
news:10************@corp.supernews.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.Value))
strPass = (Trim(txtPass.Value))
Set dbs = CurrentDb

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

Set rst = dbs.OpenRecordset(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

P: n/a
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*******@hotmail.com> wrote in message
news:e6*************************@posting.google.co m...
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********@knospamlogy.net> wrote in message

news:<10*************@corp.supernews.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********@knospamlogy.net> wrote in message
news:10************@corp.supernews.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.Value))
strPass = (Trim(txtPass.Value))
Set dbs = CurrentDb

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

Set rst = dbs.OpenRecordset(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 discussion thread is closed

Replies have been disabled for this discussion.