Solved

Ho to Create a dBase DSN in Visual Basic?

Posted on 1999-01-20
6
764 Views
Last Modified: 2013-11-24
I was using Q171146 at http://www.codeguru.com/vb/links/jump.cgi?ID=347 as an example creating my dBase DNS. I set a driver to
strDriver = "Microsoft dBase Driver (*.dbf)",
provided attrributes and hWnd as a parameters for the API function from ODBCJT32.DLL:
intRet = ConfigDSN(hWnd,ODBC_REMOVE_DSN,strDriver, strAttributes)
I was surprized when instead of "ODBC dBase Setup" dialog "ODBC Microsoft Access 97 Setup" dialog appeared. I tried to set it to a different drivers but it alvays displayed  "ODBC Microsoft Access 97 Setup" dialog. What wrong did I do? Maybe I set wrong attributes? What are the attributes for dBase driver anyway, where to fing them?
An example would be appreciated very much.

0
Comment
Question by:kolobok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Author Comment

by:kolobok
ID: 1026313
Edited text of question
0
 

Author Comment

by:kolobok
ID: 1026314
Adjusted points to 100
0
 
LVL 1

Expert Comment

by:Seeker092397
ID: 1026315
Unless you want to remove an existing DSN you should't use ODBC_REMOVE_DSN.  As i understand you want to create a new DSN so specify ODBC_ADD_DSN instead.

Hope it helps.
Best regards.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Accepted Solution

by:
arcusd earned 100 total points
ID: 1026316
'try this code

 strAttribs = "Description=" + "  DataSource" _
          + Chr$(13) + "DBQ=" + "Test.dbf"

   rdoEngine.rdoRegisterDataSource App.Title, _
               "Microsoft dBase Driver (*.dbf)", True, strAttribs

0
 
LVL 4

Expert Comment

by:arcusd
ID: 1026317
App.Title will be the DSN

strAttribs = "Description=" + "  DataSource" _
             + Chr$(13) + "DBQ=" + "Test.dbf"

rdoEngine.rdoRegisterDataSource "TEST", _
                  "Microsoft dBase Driver (*.dbf)", True, strAttribs
0
 

Author Comment

by:kolobok
ID: 1026318
ODBC_REMOVE_DSN was just mistyping. I used ODBC_ADD_DSN.
But anyway I was sujjested using different function
SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, strDriver, strAttributes) and it worked perfectly with the same attributes and parameters.

strDriver = "Microsoft dBase Driver (*.dbf)"
    'Set the attributes delimited by null.
    strAttributes = "DSN=" & strDSN & Chr$(0)
    strAttributes = strAttributes & "DefaultDir=" & strDefDir & Chr$(0)
    strAttributes = strAttributes & "DESCRIPTION=" & strDescr & Chr$(0)
    intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, strDriver, strAttributes)

Thank you for your help
 
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question