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 #Else 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?...