Results 1 to 3 of 3

Thread: DataEnvironment SQL Problem

  1. #1

    Thread Starter
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290

    Question DataEnvironment SQL Problem

    I have created a dataenvironment within VB which is connected to an ODBC database. I'm trying to creat a report from a command object added to the connection object in the dataenvironment. With the command object I want to be able to pass a parameter to it form within the program that the user would type or select. The command object is an SQL type. Everytime I go to run it from within the SQL Builder I get an error that states the following: "Provider cannot derive parameter information and SetParameterInfo has not been called." Second if I try to run my program and where the user would select what they would like to set the report to I get the following error: "Error -2147217833 [Microsoft][ODBC Microsoft Access Driver]String data, right truncated (null)". The following is some of my code.


    SQL statement in the command object in the dataenvironment object

    SELECT MEMBERS.IDNO, MEMBERS.FIRSTNAME,
    MEMBERS.LASTNAME, GENTYPES.`DESC`,
    MEMBERS.GENDATEPD, MEMBERS.GENAMTPD,
    MEMBERS.GENCHECKNO, MEMBERS.GENEXPIRES,
    MEMBERS.GENTYPE
    FROM GENTYPES, MEMBERS
    WHERE GENTYPES.GENTYPE = MEMBERS.GENTYPE AND
    members.gentype = ?
    ORDER BY MEMBERS.GENEXPIRES


    Code in the program where the user/client will select or type in what they want.

    Private Sub cmdTypeCode_Click(Index As Integer)
    Dim DE As New YWCAEnvironment

    Select Case Index
    Case 0
    If Trim(Me.Combo1.Text) = "Code" Then
    MsgBox "You must select a type in order to generate the report! Please try again." _
    , vbInformation, "Invalid Entry"
    Exit Sub
    End If
    Select Case intReportType
    Case 1
    Screen.MousePointer = 11
    mdiYWCA.StatusBar1.Panels(1).Text = "Please wait generating report..."
    'DE.MemExp1 is the command object in the dataenvironment which accepts
    'one parameter which is what the user/client wants to base the report on.
    DE.MemExp1 UCase(Left(Me.Combo1.BoundText, 1))
    Case 2
    Screen.MousePointer = 11
    mdiYWCA.StatusBar1.Panels(1).Text = "Please wait generating report..."
    'DE.MemExp2 is the command object in the dataenvironment which accepts
    'one parameter which is what the user/client wants to base the report on.
    DE.MemExp2 Me.Combo1.BoundText
    End Select
    Case 1
    End Select
    Screen.MousePointer = 0
    Unload Me
    Exit Sub


    Any help would be appreciated.

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Location
    Olavarría, Buenos Aires, Argentina
    Posts
    26
    Hi! I'm sorry. I won't help you. I have the same problem. I have tried many times to fix it and I had no way to do it.
    I just want to tell you that if I came across a solution, I will tell you. And I hope you tell me if you got the solution.
    PandaNet!

  3. #3
    Lively Member
    Join Date
    Jun 2002
    Location
    Kuwait
    Posts
    85
    hi try this

    DE.commands("MemExp1").Parameters(0) = Me.Combo1.BoundText
    Your attitude determines your altitude!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width