Ask a Question related to Dreamweaver AppDev, Design and Development.
-
dlcmpls #1
Merging ASP code for dsn-less connection
Hi Everyone. I need a little help with an asp dsn-less connection. I
currently have an application that uses a dsn less connection. It was hand
coded by a programmer who no longer works for me, but the code works great.
Now, I have expanded the application and used DW's server behaviors to write
all my asp. Again, it worked great, though I did have to set up a dsn and use
that for the conn to my database. I tried in vain to get DW to use a
dsn-less connection for the new parts of my app, but was unsuccessful so I gave
up and created a dsn. So I now have a fully working app that uses a dsn conn
and a dsn-less conn. Everything is currently running on our internal dev
server. When I move the app to the live server, I'd like to use all dsn-less
connections. So here's my question...can anyone tell me how to modify DW's
code (that uses dsn) to make a dsn-less connection that will work in DW?
Here's the blocks of code I currently use: dsn-less: '// OPEN DATABASE
CONNECTION PathToDB = '../sample.mdb' Dim conn Set conn =
Server.CreateObject('ADODB.Connection') conn.Open('DRIVER={Microsoft Access
Driver (*.mdb)}; DBQ=' & _ Server.MapPath(PathToDB))
------------------- dsn using DW: var ViewIssues =
Server.CreateObject('ADODB.Recordset'); ViewIssues.ActiveConnection =
MM_connViewPoint_STRING; ViewIssues.Source = 'SELECT * FROM issues ORDER BY
EndDate ASC'; ViewIssues.CursorType = 0; ViewIssues.CursorLocation = 2;
ViewIssues.LockType = 1; ViewIssues.Open(); var ViewIssues_numRows = 0;
--------- So how can I merge the 2 blocks of code to create 1 dsn-less
connection that will work in DW? Any help is appreciated. dlc
dlcmpls Guest
-
Disconnect connection to database in code
I need to include a statement in my code to "disconnect the connection to the database once you have fetched the data necessary". I researched the... -
mysql connection error code 404
i am using a mac and trying to set up the ysql connection with no luck at all . i had it going ok on my windows machine but now nothing. i can write... -
more connection code problems
Hi Stuart, The code below doesn't use an ADODB.Command object - it uses an ADODB.Recordset object Also, it implicitly creates an... -
connection code, I think.
I'm used to doing ASP with SQL Server, but now I'm doing something with Access. Never understood connection strongs, but managed to get by with... -
Maybe Database connection pools should be managed by Admins instead of Developers using Code?
This would be something that 2003 server and ASP.Net would use, ie, another section of the IIS whereas you could manage connection strings and such... -
Paul Whitham TMM #2
Re: Merging ASP code for dsn-less connection
DW will have created a connection file which it will have placed in a
/connections folder. A DSN connection will look something like this
<%
Dim MM_conMag_STRING
MM_conMag_STRING = "dsn=SNZSched;"
%>
To change this to DSN-less the second line becomes
MM_conMag_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("/_database/schedule2002.mdb")
if you are using the server mapping or the following if you specify absolute
addresses.
MM_conMag_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=d:\magazineadverts\schedule2002.mdb;"
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"dlcmpls" <webforumsuser@macromedia.com> wrote in message
news:d0l244$cuk$1@forums.macromedia.com...hand> Hi Everyone. I need a little help with an asp dsn-less connection. I
> currently have an application that uses a dsn less connection. It wasgreat.> coded by a programmer who no longer works for me, but the code workswrite> Now, I have expanded the application and used DW's server behaviors touse> all my asp. Again, it worked great, though I did have to set up a dsn andgave> that for the conn to my database. I tried in vain to get DW to use a
> dsn-less connection for the new parts of my app, but was unsuccessful so Iconn> up and created a dsn. So I now have a fully working app that uses a dsndev> and a dsn-less conn. Everything is currently running on our internaldsn-less> server. When I move the app to the live server, I'd like to use allDW's> connections. So here's my question...can anyone tell me how to modifyAccess> code (that uses dsn) to make a dsn-less connection that will work in DW?
> Here's the blocks of code I currently use: dsn-less: '// OPEN DATABASE
> CONNECTION PathToDB = '../sample.mdb' Dim conn Set conn =
> Server.CreateObject('ADODB.Connection') conn.Open('DRIVER={MicrosoftBY> Driver (*.mdb)}; DBQ=' & _ Server.MapPath(PathToDB))
> ------------------- dsn using DW: var ViewIssues =
> Server.CreateObject('ADODB.Recordset'); ViewIssues.ActiveConnection =
> MM_connViewPoint_STRING; ViewIssues.Source = 'SELECT * FROM issues ORDER> EndDate ASC'; ViewIssues.CursorType = 0; ViewIssues.CursorLocation = 2;
> ViewIssues.LockType = 1; ViewIssues.Open(); var ViewIssues_numRows = 0;
> --------- So how can I merge the 2 blocks of code to create 1 dsn-less
> connection that will work in DW? Any help is appreciated. dlc
>
Paul Whitham TMM Guest



Reply With Quote

