How to use sqlconfigdatasource correctly with mfc vc++ ms access driver

K Roy Chowdhury 20 Reputation points
2024-06-29T05:25:51.9533333+00:00

We want to use ms access driver for 64 bit platform in an mfc VC++ doc-view architecture project.

What are the prerequisite for the computer running on windows 11 professional.

Return value is coming as 0.

We want to use 64 bit platform for USER DSN.

Return error message is "the system can not find the path specified." against the code

BOOL RetValue = FALSE;

DWORD errorCode;

char errorMsg[512];

const char* driver = "Microsoft Access Driver (.mdb,.accdb)";

const char* attributes = "DSN=dsnCASTeR1\0DBQ=E:\CASTeR 8.1 Setup Files\exe\CASTeR.mdb\0";

RetValue = SQLConfigDataSource(NULL, ODBC_ADD_DSN, driver, attributes); // Create the DSN

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,268 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 106K Reputation points MVP
    2024-06-29T08:40:32.7433333+00:00

    Don't know why you tagged this question with SQL Server, since there is no relation to SQL Server as far as I can see.

    But I'm thinking, don't you need to double the backslashes in the string literal?


0 additional answers

Sort by: Most helpful