Hello everybody!

I am a .net beginner. At the moment I have a problem with ODBC
connection, Access Report printing and SQL Server Authentication.
Let me explain better: I want my software to be able to open an Access
Report which will show records from a SQL Server database based on a
remote machine.
Now the first problem: I created the ODBC connection to this remote
database, but can’t seem to find any way to specify SQL authentication
ID and password login. Surfing on the net I found that it’s not
possible to store such informations programmatically (am I wrong?) and
so I skipped the problem thinking that there could be a way to do that
when printing the report.
Now I have this ODBC connection with no password. I instantiated a
Access.Application object and gave the command to open the database
and print the report.

-----
objaccess.OpenCurrentDatabase(lstrReport, Exclusive:=False,
bstrPassword:="0123")

objaccess.DoCmd.OpenReport(ReportName:="SupportHistory",
View:=Access.AcView.acViewPreview, FilterName:="",
WhereCondition:=lstrWhereCommand,
WindowMode:=Access.AcWindowMode.acWindowNormal)

objaccess.Visible = True
-----

The software works fine but every time I try to open the report I am
asked for the login SQL ID and password, which is very annoying. As
you can see I'm not opening any connection, so I really don't know
where I could specify any password or user name. Maybe I should, but I
can't understand where. I tried to specify bstrPassword:=[My password]
on the opencurrentdatabase method, but no luck.
Is there a way to pass these informations by software when I set up
the connection or when I open the report?

Ah, I’m just following orders so even if there is a better way to do
that, just help me on this point. Thank you very much!

Reply via email to