Pro VB 6For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
i have a datagrid connected to an ado source. Im setting the grid.datasource property at run time giving to it a recordset that comes from a dll with aduseclient switch on it.
i dont have problems on a lot of system, but a particular one display the error i write at the beggining...
any one have any clue about what can be happening here???
thank you in advance....
HTH
Gonzalo
__________________
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification : WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the proof.
================================================== =========
...
Set grdDatos.DataSource = Nothing <- i clear the data grid
Set grdDatos.DataSource = ObjSiap.ObjContribs.DarListaContribuyentes(True, True, ObjConfi.bOrdenLC, ObjConfi.sNumColLC) <- this method return a recordset.. it's on a dll
grdDatos.Refresh <- another try to fix the problem
the error is somewhere between the set datasource and the refresh...
in the dll the code is:
Code:
Public Function DarListaContribuyentes(bPf As Boolean, bPj As Boolean, bAsc As Boolean, sTipo As String) As ADODB.Recordset
Dim Rs As ADODB.Recordset
Set Rs = New ADODB.Recordset
Dim sSql As String
sSql = ""
If bPf And bPj Then
sSql = " "
ElseIf bPf Then
sSql = " WHERE tipopersona = 0"
ElseIf bPj Then
sSql = " WHERE tipopersona = 1"
End If
If StrComp(UCase$(sTipo), "C") = 0 Then
sSql = sSql & " ORDER BY cuit"
Else
sSql = sSql & " ORDER BY descrip"
End If
If Not bAsc Then
sSql = sSql & " DESC"
End If
Rs.CursorLocation = adUseClient
Rs.Open "SELECT CUIT,DESCRIP from contribs" & sSql, ClaseBase_ConexionBD, adOpenStatic
Set DarListaContribuyentes = Rs
Set Rs = Nothing
End Function
Ok, what is the setup on that one machine that is giving you problems? There has to be something different... So that code works on all of the other machines?
as far as i see, there is no diference in the setup. the install process is handle by install shield. i run the depends
program to see is there was any problem but it have the same dll's that the rest of the pcs. i didn't find any info on msdn
but i find some on the google refering to some mfc libraries but that's doesn't seen to be a problem for me... or maybe yes
and i missing something...
My guess is that maybe there are differences in ADO? I mean, you said it worked correctly on other computers. Unless it happens to be permission problems from that computer in connecting to the database. Or maybe that computer can't "see" the database?
Hello i had the same problem and here is the solution first make sure msstdfmc.dll file exists in ur "system32" folder for winxp or "system" folder in win98,if it exists then goto Start>Run and type in the following: RegSvr32 <the path to system32 / system dir>\msstdfmt.dll
Now the Datagrid Control Works fine in Vb.net as well as Vb 6.0