Results 1 to 2 of 2

Thread: Registry Problem

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    44

    Unhappy

    Hello
    This is strange.
    i made a reg. file that auto make DSN on computer:


    REGEDIT4

    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data

    Sources]
    "north"="SQL Server"

    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\north]
    "Driver"="C:\\WINNT\\System32\\sqlsrv32.dll"
    "Description"="North (Sql Server)"
    "Server"="(local)"
    "Database"="Northwind"
    "Trusted_Connection"="Yes"


    when i meregd the file it worked fine . and that DSN has benn created..

    but , when i added it to the "Package and Deplyment" and then tryed to make the cab file... i got this error msg:
    "c:\db\registry.reg is not recognized as a vaild registry file"

    what is it ,whats wrong with it, what to do?
    this is very important to me
    Please try to help asap
    Thanks.
    Namo.

  2. #2
    Guest
    maybe you could try doing the same with vb code:

    best regards

    Sascha

    '**********************************************************

    Public Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" _
    (ByVal hwndParent As Long, _
    ByVal fRequest As Long, _
    ByVal lpszDriver As String, _
    ByVal lpszAttributes As String) As Long


    ' SQLConfigDataSource consts
    Public Const ODBC_ADD_DSN = 1 ' Add user data source.
    Public Const ODBC_CONFIG_DSN = 2 ' Configure user data source.
    Public Const ODBC_REMOVE_DSN = 3 ' Remove user data source.
    Public Const ODBC_ADD_SYS_DSN = 4 ' Add system data source
    Public Const ODBC_CONFIG_SYS_DSN = 5 ' Configure system data source
    Public Const ODBC_REMOVE_SYS_DSN = 6 ' Remove system data source

    Sub CreateDsn()

    Dim intAction As Integer, strDSN As String, lngRetVal As Long
    Dim strDriver As String, strAttributes As String

    intAction = 1

    ' Set the DSN Name
    strDSN = "Some_DSN_Name"

    ' Set the DB Path
    strDBPath = "c:\temp\database.mdb"

    ' Set the Driver info
    strDriver = "Microsoft Access Driver (*.mdb)" & Chr(0)

    ' Set the Attributes
    strAttributes = "DSN=" & strDSNName & Chr(0)
    strAttributes = strAttributes & "Uid=" & Chr(0) & "pwd=" & Chr(0)
    strAttributes = strAttributes & "DBQ=" & strDBPath & Chr(0)

    lngRetVal = SQLConfigDataSource(0, intAction, strDriver, strAttributes)

    End Sub

    '*********************************************************


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width