Elisa Posted January 9, 2003 Posted January 9, 2003 Hi I'm using .NET and I can't find the correct syntax for the Data Source parameter of my connection. It is all ok when I write "Dat a Source = C:\Databases\prova.mdb" but what is the correct syntax for a virtual path? If I use "Data Source= prova.mdb" it seems not to work, even the db is in the same folder of the application. A second question: can I use the SELECT ... INTO instruction to put some values in some application variables? Sorry I know these are simplest questions but I am totally new ti this ... :) Quote
*Experts* Nerseus Posted January 9, 2003 *Experts* Posted January 9, 2003 You can use Environment.CurrentDirectory to get the current directory. Make sure your mdb is in the \bin\Debug folder and not the code folder as well and then using "Data Source=prova.mdb" should be fine SELECT...INTO is SQL only to dynamically create a real or temp table. You'll want a regular SELECT statement and pull the value from the returned DataSet or DataReader. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Elisa Posted January 9, 2003 Author Posted January 9, 2003 Thank you! And in this way I think I can also export the application on another pc without changing the path, right? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.