|
Also see here[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi,
say for example,
i have created one database application in vc, and i access the MS access database through that.
so first i create a DSN from control panel\odbc datasources.
obviously i have to access that database through the dsn from vc++.
now if i want to install it on my clients machine, i have to copy the files first, then map the DSN and then run the application.
now what i want is, is there any method to automate the creation of DSN, such that, just by a single click on my application, this DSN gets created.
thanks.
|
|
|
|
|
There are a lot of setup-generation suites that allow you to start scripts during the setup-process.
One of these is NSIS[^], and its free even for commercial use.
There are many others. Just google.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
thanks for your reply.
i shall verify the tool.
but i wanted some code snippet which can create the dsn if i supply the database filename and dsn name.
|
|
|
|
|
To be honest, I have not the faintest idea what 'dsn' is.
But as you seemed to know how to make one, I showed you a way how to automate that on your client computers.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
DSN means Data Source Name(I also have known it today!) . I guess it is the name that C++ will use in connection to a driver to a database.
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
And DSN's are just about competely useless in todays environment...
Unless you're actually going for lower performance and a more "generic" approach to database work.
|
|
|
|
|
Dave Kreskowiak wrote: And DSN's are just about competely useless in todays environment... Unless you're actually going for lower performance and a more "generic" approach to database work.
Okay, i am interested! What makes you say so
What is the better alternative?
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
|
|
chandu004 wrote: ...is there any method to automate the creation of DSN...
Yes, but why not just use a DSN-less connection?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
To configure data sources programatically, see
Installing and Configuring the ODBC Software[^]
particularly the sections "Configuring Data Sources" and "Registry Entries for Data Sources".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
What can I do to prevent the following:
Invalid Cursor State Error with the MS Oracle ODBC Driver
I have visited this link: Invalid Cursor State[^] and tried what they suggested, i.e: If using the ODBC API directly, call SQLPrepare() before calling SQLExecute() and SQLExtenedFetch() to refresh the recordset. But it is not working, I still receive the error. I have notied that if I create a new recordset for each sql statement is works, but that creates huge memory leaks.
Can anyone please help me ???
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi All,
In my project I want to check Whether user press Enter key or not after type a text in text box. In which event I have to check it and how can i check it.
Thanks in Advance
Atul
|
|
|
|
|
try using the pretranslatemessage handler.
but here, you have to implement your own logic.
any mmore clarification required, get back.
|
|
|
|
|
What type is the project?
Maxwell Chen
|
|
|
|
|
|
Did you use of PreTranslateMessage .
|
|
|
|
|
The use of PreTranslateMessage() *might* work, but most implementations are incorrect. The other downside is that it permanently ties the child control to the parent. A better solution is to derive a class from CEdit . Override the OnGetDlgCode() method and return DLGC_WANTALLKEYS . Then override the OnChar() method like:
void CMyEdit::OnChar( UINT nChar, UINT nRepCnt, UINT nFlags )
{
switch (nChar)
{
case VK_RETURN:
GetParent()->SendMessage(some_custom_msg, GetDlgCtrlID(), (LPARAM) this);
return;
}
CEdit::OnChar( nChar, nRepCnt, nFlags );
} When the edit control "sees" the Enter key, it posts a message to the parent indicating such. The parent can then respond accordingly, if at all.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How early can a Windows service start up?
Comparing the below:
1) a Windows service application (an NT service),
2) a PCI bus device driver,
Can a Windows service be started up earlier than a PCI bus device driver?
Maxwell Chen
|
|
|
|
|
Hi
i am feel little bit shame for asking this question.
Actually i am making a application in VC++(MFC) single dilog based
in form view. I want to close the maximizeproperty of form
I mense i can minimize form but not maximize. Can any one told me how
we can do this.
Regard's
Kaushik
|
|
|
|
|
Right click on the form to see the properties of form.
Open styles tab, check minimize box and uncheck Maximize box.
|
|
|
|
|
sir ji
My application type of Single dialog based
and its style is Child and border is thin
In this case maximize and minimize property is
disable.
Can u told me any alternative way..............
Regard's
Kaushik
|
|
|
|
|
write this line in OnInitDialog function.
ModifyStyle (NULL, WS_MINIMIZEBOX);
Hope this will work.
By the way, why don't you just change your dialog style from child to popup ?
|
|
|
|
|
I know about the Two ways of making the .DLL.
1)extern "c" _declspec(dllexport) funX() {} and
2)Throught .Def file in which we are Writing only function names we want to export
EXPORT<br />
FunX @1
I have Some Question about that.
1)What is/are the diffn betn them and
2)What mean by extern "c"
3)"@" what is indication of this symbole. I tried without it and Dll Works Fine.
|
|
|
|