Re: Read info from a file
From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 11/01/04
- Next message: Douglas Marquardt: "Re: Read info from a file"
- Previous message: Newbie: "Re: Read info from a file"
- In reply to: Newbie: "Re: Read info from a file"
- Next in thread: Douglas Marquardt: "Re: Read info from a file"
- Reply: Douglas Marquardt: "Re: Read info from a file"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Nov 2004 10:28:27 -0500
Gosh ... that is an oldie file! ... it's for VB3 (hence the MAK file). You
can try to fix it yourself by opening it in VB6 and once past the errors
adding the required controls, or you can take a look at this which may help
... http://vbnet.mvps.org/code/file/pprofilebasic.htm
-- Randy Birch MS MVP Visual Basic http://vbnet.mvps.org/ "Newbie" <nospam@noidea.com> wrote in message news:uOIatLCwEHA.2804@TK2MSFTNGP14.phx.gbl... : I have tried to download the sample that you told me but it doesn't work or : rather wont open on my machine. : : Any other samples : : Thanks : "Douglas Marquardt" <no_spam@dummy.com> wrote in message : news:OAg%23NJCwEHA.1988@TK2MSFTNGP12.phx.gbl... : > Hi: : > : > If you want to go the ini route, then have a look at the sample I : > suggested. : > (which should work just fine for what you want). : > : > If you want to use the registry, then have a look in the vb docs under : > "GetSetting" and "SaveSetting" : > : > Doug. : > : > : > "Newbie" <nospam@noidea.com> wrote in message : > news:uLFC26BwEHA.4048@TK2MSFTNGP15.phx.gbl... : >> Thanks : >> : >> Yes I am using ADO to connect to the db and the only part of the : >> connection : >> string I wanted to read from the file was the Initial Catalog and the : >> Data : >> Source as these can change. : >> : >> Any ideas how I do this? : >> "Douglas Marquardt" <no_spam@dummy.com> wrote in message : >> news:%23Vh8g0BwEHA.4028@TK2MSFTNGP15.phx.gbl... : >> > Hi: : >> > : >> > For reading ini files, have a look at the KPINI.ZIP file located at: : >> > : >> > http://www.mvps.org/vb/index2.html?samples.htm : >> > : >> > I wouldn't recommend storing the connect strings in a file, : >> > unless you're not worried about db security. : >> > : >> > Are you using ADO to connect to the db? : >> > If so, then you could use the built in login for the provider,i.e. : >> > : >> > Dim cn As ADODB.Connection : >> > : >> > On Error GoTo EH : >> > : >> > Set cn = New ADODB.Connection : >> > cn.Provider = "SQLOLEDB" : >> > cn.Properties("Prompt").Value = adPromptAlways : >> > cn.Open : >> > : >> > ...etc : >> > : >> > Done: : >> > 'Clean up here, i.e. close the connection, etc. : >> > Exit Sub : >> > EH: : >> > Select Case Err.Number And Not vbObjectError : >> > Case 3662 'Open method was cancelled by the user : >> > ..etc : >> > Case Else : >> > MsgBox Err.Description : >> > End Select : >> > Resume Done : >> > : >> > Note: the above code was off the top of my head and may : >> > not be 100% correct --- but you get the idea. : >> > : >> > Hope this helps, : >> > : >> > Doug. : >> > : >> > : >> > "Newbie" <nospam@noidea.com> wrote in message : >> > news:eF1IzgBwEHA.3276@TK2MSFTNGP15.phx.gbl... : >> >> Hi, : >> >> : >> >> I have a project that is going to connect to a SQL Server. : >> >> : >> >> At the moment whenever I have to try out the .exe I have to rewrite : >> >> the : >> >> connection string so that it looks at the correct SQL Server and : >> >> Database : >> >> name. : >> >> : >> >> Is it possible to have these settings in a for eg .ini file and have : >> >> the : >> >> program read the entries from here. : >> >> : >> >> If yes what would be the best way to go about this and how would I : >> >> read : >> >> from : >> >> a .ini file? : >> >> : >> >> Thanks : >> >> : >> >> : >> > : >> > : >> : >> : > : > : :
- Next message: Douglas Marquardt: "Re: Read info from a file"
- Previous message: Newbie: "Re: Read info from a file"
- In reply to: Newbie: "Re: Read info from a file"
- Next in thread: Douglas Marquardt: "Re: Read info from a file"
- Reply: Douglas Marquardt: "Re: Read info from a file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|