473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Access -> SQL Server

Hi,
I have a probelm with connection to SQL from Access. I've seen same
advices from you, but I steel have a problem.
I need select some data form SQL Server using access's visual basic.
Please give me a example (some pice of code).

Thanks for help.

mw

Jan 26 '06 #1
3 1295
Now i'm using:
Set cnnOLEDB_SQLServer = New ADODB.Connection
gstrSQLServerName = "C-MWA"
cnnOLEDB_SQLServer.Open "Provider=sqloledb;" & _
"Data Source=" & gstrSQLServerName & ";" & _
"Initial Catalog=pubs;User Id = Test; " & _
"Password=aaa;"

but there is a error:
"Login failed for user 'Test'. Reason: Not associated with a trusted
SQL Server connection"

I'm using windows user to authorize. The user is Test and password aaa.
Am I change some permisions in data base or server?

Jan 26 '06 #2
"Marcin Wasilewski" <ma********************@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Now i'm using:
Set cnnOLEDB_SQLServer = New ADODB.Connection
gstrSQLServerName = "C-MWA"
cnnOLEDB_SQLServer.Open "Provider=sqloledb;" & _
"Data Source=" & gstrSQLServerName & ";" & _
"Initial Catalog=pubs;User Id = Test; " & _
"Password=aaa;"

but there is a error:
"Login failed for user 'Test'. Reason: Not associated with a trusted
SQL Server connection"

I'm using windows user to authorize. The user is Test and password aaa.
Am I change some permisions in data base or server?


If you want to use a Windows account, then you do not give the username and
password! That is the point. You have already logged on to Windows by
giving these details once - so Windows knows who you are - and so the server
can trust you. The connection string is set up like this:

strConnection = "Provider=sqloledb;" & _
"Data Source=C-MWA;" & _
"Initial Catalog=pubs;" & _
"Integrated Security=SSPI"
Jan 26 '06 #3
>
If you want to use a Windows account, then you do not give the username and
password! That is the point. You have already logged on to Windows by
giving these details once - so Windows knows who you are - and so the server
can trust you. The connection string is set up like this:

strConnection = "Provider=sqloledb;" & _
"Data Source=C-MWA;" & _
"Initial Catalog=pubs;" & _
"Integrated Security=SSPI"


Of course it works. Thank you very much. If it isn't a problem can you
give me example if I need to connect with some server whih isn't on
local computer. Of course I know IP adress, server name, ures and
password name.

Once again thank you.

Marcin

Jan 26 '06 #4

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

Similar topics

1
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
47
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
4
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
70
by: lgbjr | last post by:
Hello All, I've been developing a VB.NET app that requires the use of a DB. Up to now, I've been using Access. It's a bit slow, but everything works. I'm at a point now where I need to decide if...
49
by: Mell via AccessMonster.com | last post by:
I created databases on Access 2003 and I want to deploy them to users. My code was also done using 2003. If they have Ms Access 2000 or higher, will they be able to use these dbs with all code,...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
37
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...
34
by: Mathieu Trentesaux | last post by:
Hello I downloaded Office 2007 for this reason : It seems, once again, that it is impossible to save any modification done in a VBA library, from the main project in Access. The save button...
37
by: Allen Browne | last post by:
If you develop for others, you probably have multiple versions of Access installed so you can edit and create MDEs for clients in different versions. This works fine under Windows XP, even with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
agi2029
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,...
0
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...

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.