Guys, does anyone of you have Windows 7?...

Okay, here is my problem can you kindy test this code in windows 7.

Public Sub createAccessDSN(MDBPath As String, xDescription As String, xDSN As String, xUID As String, Optional xPassword As String)
    'Creating the DSN

#If Win32 Then
   Dim intRet As Long
   Dim intRet As Integer
#End If

Dim strDriver As String
Dim strAttributes As String

strDriver = "Microsoft Access Driver (*.mdb, *.accdb)"

strAttributes = strAttributes & "DESCRIPTION=" & xDescription & Chr$(0)
strAttributes = strAttributes & "DSN=" & xDSN & Chr$(0)
strAttributes = strAttributes & "PWD=" & xPassword & Chr$(0)
strAttributes = strAttributes & "UID=" & xUID & Chr$(0)
strAttributes = strAttributes & "DBQ=" & MDBPath & Chr$(0)

intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_SYS_DSN, _
strDriver, strAttributes)

' DSN created
End Sub

Heres how to use it.

'Create a DSN for Reports
Call Data.createAccessDSN("DatabasePath.mdb", "DBDSN", "ANYTHING", "Admin", "Optional")

I don't know if a this is working in Windows 7 because I don't have a Windows 7 to test it. So please help me to test this code or if you have other ways in creating a DSN using VB, please kindly help me.

and in crystal report 8.5 installed on Win7, what is the cause of "Server has not been opened" error?...

:-O ow.. Nobody replies yet..

Okay, I have updated the code and used DAO 2.5 / 3.51 instead of the API, I also attached a sample VB6 app with a compiled version and an Access 2007 database so it can be tested.

Please test this application on your WINDOWS 7. This will just create an ODBC connected, and thats it. I just want to know if this will work under Windows 7.

I will be waiting for your replies. Thanks.

Still no replies.. :sad: Please test the previously attach vb6 project in Windows 7, and Vista so I have an idea if it works or not..

This article has been dead for over six months. Start a new discussion instead.