Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

cant see my report in network,Uknown Database says in crystal report..

$
0
0
I'm creating a program that also run's in a network, it runs perfectly, but my only problem is that i cant view the report. i use MySQL database,and installed MySQL connector ODBC for the crystal report, the CR files are on the server, i already configured it on the windows Administrative tools, Data source, Mysql Odbc Driver 3.51, with datasource name, server which is localhost, user is blue, with password, and database 'utilization'.

i can view the report when im on the server, but when i try to open it on another computer it say's :

Crystal Report Viewer

Logon Failed.
Details: HY000:[MySQL][ODBC 3.51 Driver]Uknown Database 'utilization'


but i can access the database, i can add,edit,delete and view transactions in every pc locally, but i cant veiw the report of any transaction in crystal report. i can access the Crystal Report File but the database is uknown.
i dont know if i have an error on my code. All i want is to see every transaction through crystal report.



This code here is in a module, named connection:


Public Sub Set_MySQLConn(ByRef sConnection As ADODB.connection, sserver As String, port As String, sdbase As String, susername As String, Optional stpwd As String)

            
ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=" & sserver & ";Port=" & port & ";Database=" & sdbase & ";User=" & susername & ";Password=" & stpwd & ";Option=3;"
    
    sConnection.Open ConnectionString

End Sub








and this here code is what i use to set and open the database(it is on every form load event, and it works perfectly):


 Set_MySQLConn cn, "192.168.1.68", "3306", "utilization", "cubski", "12345"




this code below is from the Report form:


Dim cn As New ADODB.connection
Dim rs As New ADODB.Recordset
Dim rrpt As New CRAXDRT.Application
Dim mreport As New CRAXDRT.Report

Private Sub Form_Load()

    Set_MySQLConn cn, "192.168.1.68", "3306", "utilization", "cubski", "12345"
    
            If equipID <> "" Then '(equipID is a global string declared at the connection module)

                If rs.State = adStateOpen Then rs.Close
                rs.CursorLocation = adUseClient
                
                Query = "Select * from equipment where equipment_id = '" & equipID & "'"
    
                rs.Open Query, cn, adOpenForwardOnly
                
                Set mreport = rrpt.OpenReport("\\192.168.1.68\Documents\Kith\epcc\Utilization\Reports\Equipment.rpt", 1)'(the localtion of this CR file is accessible)
                mreport.Database.SetDataSource rs
                crystlEquipment.ReportSource = mreport
                crystlEquipment.ViewReport
                

                
            End If

end sub
   


Hope someone could help...
any other options would be nice to know...

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>