|
-
Oct 23rd, 2006, 05:11 PM
#1
Thread Starter
New Member
vb 6.0,crystal reports 8.0,PostgreSQL(win)
Hello :
please help , i'm working with Postgresql i can connect to it (odbc and oledb) when i try to generate a report using the crviewer i got very confused with the connection methods(Logoninfo ,logon server etc) and with the dll that i need inside the project i already got the active x run time library , but i don't know if i need to incorporate to the reference another dll type .
please help
thanks in advanced
-
Oct 23rd, 2006, 09:52 PM
#2
Re: vb 6.0,crystal reports 8.0,PostgreSQL(win)
If you want to use the crystal report in the VB then there is crystal report tutorial at my signature so click there.
You are using just you check the connection with the database and the Query.
-
Oct 24th, 2006, 09:17 AM
#3
Thread Starter
New Member
Re: vb 6.0,crystal reports 8.0,PostgreSQL(win)
thanks for the reply , but i still have the problem, i'm going to post some code,(you will have to forgive me but , i don't how to post the code the rigth way) :
make the connection :
Private Sub crearConexion()
Dim cadenaConexion As String
cadenaConexion = "DRIVER={PostgreSQL};SERVER=192.168.25.197;port=5432;DATABASE=test;UID=postgres;PWD=post;"
Set conexion = New ADODB.Connection
conexion.Open cadenaConexion
Set consultaSQL = New ADODB.Command
Set consultaSQL.ActiveConnection = conexion
End Sub
load the report :
Public Function CargarReporte(strTitulo As String, strArchivoRPT As String, strCadenaSQL As String, Optional strSpDatosAdicionales As String = "spCorporativo") As CRAXDRT.Report
Call crearConexion
Dim rdApp As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Screen.MousePointer = vbHourglass
Set rdApp = CreateObject("CrystalRuntime.Application")
Set Report = rdApp.OpenReport(strArchivoRPT)
Report.ReportTitle = strTitulo
consultaSQL.CommandText = strCadenaSQL
consultaSQL.CommandType = adCmdText
Set recordSet = consultaSQL.Execute
Report.Database.AddADOCommand conexion, consultaSQL
Report.AutoSetUnboundFieldSource crBMTName
Call cerrarConexion
Set rdApp = Nothing
Set CargarReporte = Report
Screen.MousePointer = vbDefault
End Function
again thanks
-
Oct 24th, 2006, 10:14 PM
#4
Re: vb 6.0,crystal reports 8.0,PostgreSQL(win)
You post the code, use use VBCODE tab In [] and code and end it with the same way [/VBCDOE].
Tell that in which line error you are getting and what type of the error is it.
-
Oct 25th, 2006, 09:53 AM
#5
Thread Starter
New Member
Re: vb 6.0,crystal reports 8.0,PostgreSQL(win)
thanks, the problem is that the program crash , send a message that the vb has suffer an unexpected error. when you click on the link , you can see "p2smon.dll" , this is the reason of the unexpected error.
make the connection :
VB Code:
Private Sub crearConexion()
Dim cadenaConexion As String
cadenaConexion = "DRIVER={PostgreSQL};SERVER=192.168.25.197;port=5432;DATABASE=test;UID=postgres;PWD=post;"
Set conexion = New ADODB.Connection
conexion.Open cadenaConexion
Set consultaSQL = New ADODB.Command
Set consultaSQL.ActiveConnection = conexion
End Sub
load the report:
VB Code:
Public Function CargarReporte(strTitulo As String, strArchivoRPT As String, strCadenaSQL As String, Optional strSpDatosAdicionales As String = "spCorporativo") As CRAXDRT.Report
Call crearConexion
Dim rdApp As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Screen.MousePointer = vbHourglass
Set rdApp = CreateObject("CrystalRuntime.Application")
Set Report = rdApp.OpenReport(strArchivoRPT)
Report.ReportTitle = strTitulo
consultaSQL.CommandText = strCadenaSQL
consultaSQL.CommandType = adCmdText
Set recordSet = consultaSQL.Execute
Report.Database.AddADOCommand conexion, consultaSQL
Report.AutoSetUnboundFieldSource crBMTName
Call cerrarConexion
Set rdApp = Nothing
Set CargarReporte = Report
Screen.MousePointer = vbDefault
End Function
thank you shakti5385
-
Oct 25th, 2006, 01:02 PM
#6
Re: vb 6.0,crystal reports 8.0,PostgreSQL(win)
So you are still getting the error, to find out that in which line error is occurring please debug the code using the F8.
You are saying something about the dll so I want to say that please check that the dll is registered on your PC or not, For registering the dll just write regsvr32 and the dll path at the run prompt.
Start ->Run -> regsvr32 dll path
-
Oct 25th, 2006, 01:58 PM
#7
Thread Starter
New Member
Re: vb 6.0,crystal reports 8.0,PostgreSQL(win)
i can't debug because the program stuck . i can't use f8 or anything. the message that it's been send state that , "due to an unexpected error viusla basic has to shut down" , and also include a link to see what originate the error , in this part is where the name of the .dll it`s shown. i got .dll registred , thats fine .
maybe my problem its the way i'm doing the connection and passing to report . i don't know.
i'm taking a wild guess that the error is generated here.
conexion = connection
consultaSQL= query sentence
VB Code:
Report.Database.AddADOCommand conexion, consultaSQL
thanks shakti5385
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|