Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot acess SQL database

Status
Not open for further replies.

toon10

Programmer
Mar 26, 2004
303
DE
I have a VB application that looks at a SQL database. This works fine and the database gets entered via the username “sa” with no password. I installed the app on another PC (Windows 2000) and when I try to run it, I get the SQL connection dialog box appearing and the machine can’t see the database.

I can ping the server the database is on from that PC and the PC is definately on the company network but it won’t let me connect via the connection dialog box (SQL error 6)

Can anyone give me any leads?

Thanks
Andrew
 
...the database gets entered via the username “sa” with no password...

BAD - BAD - BAD!!! SA is the ultimate login....a user logging in with that has total control of your SQL Server. This is a BAD thing. It is a MUCH WORSE thing to not have a secure password for the SA account.

Next you will probably tell us you don't have your SQL Server patched to at least Service Pack 3a.

----------
As for your connection problem. First check what type of authentication SQL Server uses. If it's Windows Authentication Only, you can't use the SA login.

Check the SQL Server Error logs and the Windows Event Viewer Logs for any related messages.

Also, there's a lot on this forum about connection issues. Search the FAQs and the forum for any solutions.

-SQLBill

Posting advice: FAQ481-4875
 
Neither the server or database is in my control. I'm a programmer and not allowed to mess about with the SQL setup or network rights. I've done an Microsoft SQL admin course and I'm aware of the security risk of having an "sa" login acount. However, this isn't a concern of mine, just getting my application to load the data from sql when the user double clicks on it.

Like I say, I can login using the sa login on my PC, just not on the user's pc.

Cheers
Andrew
 
Did you set up an ODBC connection on the user's PC?

Have you tried making the connection via IP address vice Server Name?

-SQLBill

Posting advice: FAQ481-4875
 
I tried to setup an ODBC connection on the users PC using the ip address and when that didn't work, using the server name but again, it won't let me make a connection. I logged on as administrator to make sure that it wasn't just a user privileges issue but the same thing happened!

I converted the file system last night from FAT32 to NTFS to give me more security options on that PC but still nothing.

Cheers
Andrew
 
This should be a VB post.

Does the client have MDAC installed? Also, it would be better to just add that user to the DB and have him use trusted security instead of having to provide credentials either through code or through a logon screen.
 
It's not VB related. I can't get hold of the database by adding an ODBC connection on the control panel either.
 
Hi,

I am not to sure if this can be a possiblity. When the SQL Server was setup, what kind of authintication mechanism was selected.

What you can do to find this out is over the network try to access the default shares that is \\sql_server_machine_name\C$ (in the start -> run menu) then when it prompts you to enter the login id and password, enter the Admin login details. Now try running your app. This is just a thought maybe it was configred for mixed mode authintication..

Sorry if its of no help..

Cheers,
Vikas
 
Hi Vikas

I've tried that and it does the same thing! I'll check for updates and see if there are any service packs I need to install.

Cheers
Andrew
 
Hi Andrew,

Can you share with me the connection string that you are using in the code if any ?

Cheers,
Vikas
 
Hi

Set cn = New ADODB.Connection

With cn 'Establish a connection to the data source
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=sa;Data Source=10.125.100.150;Initial Catalog=DSQL_MBC"
.Open
End With

I know this works as I've tried it on a few PC's with different logins. It's just this one PC that it needs to operate on that refuses to connect
 
Just a thought, can you try this as well -

.ConnectionString = "User ID=sa;password=;Data Source=10.125.100.150;Initial Catalog=DSQL_MBC"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top