Home > Software engineering >  Experts, please help! VC SQL database using ODBC connection problems
Experts, please help! VC SQL database using ODBC connection problems

Time:10-27

I set up a MFC procedures, did not adopt the way of database to build, is just a dialog box procedure,
Later need to join the SQL data storage function, so the used "MFC ODBC consumer" has built a SQL data source, automatically creates a subclass of CRecordset,
Program can be used on my own computer, but on other people's computer will appear error dialog box shown in (see picture), but if the others to join in SQL access, will not make a mistake,
Excuse me each
1, how do I change program, let the program at the time of open the program and the SQL connection is established, if you can't establish a connection is not open the main program?
2, the Internet to find some methods such as CDatabase. Open the connection data source, but can't find my set up data sources, could you tell me what is the problem?



CodePudding user response:

ODBC is out of date, to build a data source, think about is, don't just query a database? Each machine hands frozen creating,
Ado also used for many years now,
I was using VC ado, ado baidu to search out a lot of
Honestly now are using ado.net because ado once development is complete, have msADO15 DLL, running is ok, not bother

CodePudding user response:

Suggest you change to ado, anyway sooner or later, to learn, this can also be used at least a few years no problem

CodePudding user response:

Data source that things seem to be configured on each machine, if other machine configuration data, your application should be can't open the database, I also don't know much about, a little under reference,

CodePudding user response:

Thank you, it seems more than learning how to learn,

CodePudding user response:

Don't know is there any way, the present situation, ladies and gentlemen?

CodePudding user response:

In a 64 - bit Windows:
64 exe and DLL in the directory c: \ Windows \ sys tem32 directory.
32 bit exe and DLL in the directory c: \ Windows \ sys wow64 directory.
So pay attention to:
In win64 system registered under 32-bit ocx DLL to 32 ocx or copy the DLL to the c: \ Windows \ syswow64 \ directory,
And registered to c: \ Windows \ syswow64 \ regsvr32 XXXXXXX ocx or DLL
Under win64 a system set up 32-bit programs use a database alias to c: \ Windows \ \ syswow64 \ cliconfg exe
Under win64 a system set up a 32-bit application system DSN to c: \ Windows \ \ syswow64 \ odbcad32 exe

CodePudding user response:

If you are using ODBC way to establish a program needs in each other's computer to build a the same ODBC data source, according to the Settings on your computer copy on his computer, if it is a common type of program you have to think of some way to write a script to automatically add this data source.

CodePudding user response:

With a database account login, do not use Windows integrated authentication