Re: Cannot display ODBC login prompt - want to connect without DSN

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



ODBC was effecitvely replaced by OLE DB Providers about 10 years ago and
these providers are available in .NET.

Depending on the database you are using, you'll need a specific provider
with a specific connection string to match it. If you want the user to be
able to supply their user ID and password, that would be a simple matter of
providing a logon form and then take the data from that form and make it
part of the connection string.

For SQL Server, you'd have something similar to this:

Dim con As New System.Data.SqlClient.SqlConnection(connectionStringHere)

Try
con.Open
'use connection here
Catch e As Exception
'handle exceptions here
Finally
con.Close()
con.Dispose()
End Try

Various configurations of connection strings can be found here:

http://ConnectionStrings.com

-Scott

"John Brown" <JohnBrown@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E7322825-2163-4B59-9AA4-0085AB397727@xxxxxxxxxxxxxxxx


"Mark Rae [MVP]" wrote:

"John Brown" <JohnBrown@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5F054111-768C-4FD8-86FF-468FB02F9312@xxxxxxxxxxxxxxxx

2) More generally, is there an equivalent to the
ADODB.Connection::Properties collection in ADO.Net?

More pertinently, why on earth are you using ODBC...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net


And what, pray tell, should I be using?


.



Relevant Pages

  • Re: problems access an MS Access 2000 DB using ASP
    ... > providers and currently she is working on the new website which currently ... In this database there is only one table. ... > specify a system file in the db connection string and also specify a ... > Set rstDB = Server.CreateObject ...
    (microsoft.public.inetserver.asp.db)
  • problems access an MS Access 2000 DB using ASP
    ... providers and currently she is working on the new website which currently ... Their server is a Win2K3 server. ... In this database there is only one table. ... specify a system file in the db connection string and also specify a ...
    (microsoft.public.inetserver.asp.db)
  • Problems accessing an MS Access 2000 DB in ASP
    ... providers and currently she is working on the new website which currently ... Their server is a Win2K3 server. ... In this database there is only one table. ... specify a system file in the db connection string and also specify a ...
    (microsoft.public.inetserver.asp.general)
  • Re: Provider-independent data access, again
    ... But I don't have a connection string, that's the reason why I need to build one! ... It's a plugin model, not a factory model that removes the need for a design-time reference to all the providers. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Close() and Dispose()
    ... _userConnectionOptions is effectively the processed connection string as the ... Setting the poolgroup to null has no noticeable ... >> Closeand Dispose() are basically the same thing on an ADO.NET ... >> object for providers shipped by Microsoft, ...
    (microsoft.public.dotnet.framework.adonet)