Skip to main content
Inspiring
December 23, 2007
Question

Dynamic Connection Strings

  • December 23, 2007
  • 1 reply
  • 278 views
Hi Guys,
Firstly seasons greetings to you all..

Im my site now using DW CS3 my user may open a varaity of databases at run time I have no idea what the databases may be as they can be created by the user all I know is there is a default database and if all else fails load it lol..

So to combat this I have made my connection string a little different from the examples in the help and it works a treat... except when in the DW envorinment its not likeing what ive done..

EG: This is what I have and works well so far when running....


MM_MyConnection_STRING = "Driver={Microsoft Access Driver (*.mdb)};Dbq=f:myserver\db\"&Session("DbName")&";Uid=;Pwd=" & strThePass & ";"


Dreamweaver doesnt like this and to work on my ste i have to remove the database password and make a standard connection string in DW so as i can work with the database....

I wonder if there is a way I can do this my way in DW or am I missing something ? What do you guys do with multiple databases with passwords and connection strings?

Thoughts or suggestions are very welcome.

Kind Regards
W

This topic has been closed for replies.

1 reply

Inspiring
December 23, 2007
"webstaffuk" <webforumsuser@macromedia.com> wrote in message
news:fklnu8$n0f$1@forums.macromedia.com...
> Hi Guys,
> Firstly seasons greetings to you all..
>
> Im my site now using DW CS3 my user may open a varaity of databases at run
> time I have no idea what the databases may be as they can be created by
> the
> user all I know is there is a default database and if all else fails load
> it
> lol..
>
> So to combat this I have made my connection string a little different from
> the
> examples in the help and it works a treat... except when in the DW
> envorinment
> its not likeing what ive done..
>
> EG: This is what I have and works well so far when running....
>
>

> MM_MyConnection_STRING = "Driver={Microsoft Access Driver
> (*.mdb)};Dbq=f:myserver\db\"&Session("DbName")&";Uid=;Pwd=" & strThePass &
> ";"
>

>
> Dreamweaver doesnt like this and to work on my ste i have to remove the
> database password and make a standard connection string in DW so as i can
> work
> with the database....
>
> I wonder if there is a way I can do this my way in DW or am I missing
> something ? What do you guys do with multiple databases with passwords and
> connection strings?
>
> Thoughts or suggestions are very welcome.
>
> Kind Regards
> W


Define a default database in the way that dreamweaver expects at
design-time, then override the setting at run-rime

dreamweaver will parse the first line and use that, Recordsets will use the
overridden value

MM_MyConnection_STRING = "Driver={Microsoft Access Driver
(*.mdb)};Dbq=f:myserver\db\default.mdb;Uid=;Pwd=defaultpass;"
MM_MyConnection_STRING = "Driver={Microsoft Access Driver
(*.mdb)};Dbq=f:myserver\db\"&Session("DbName")&";Uid=;Pwd=" & strThePass &
";"