vb6 :problem executing stored procedure, incorrect parameter type for ADODB command object/?

I'm trying to execute a SQL SERVER 2000 stored procedure from vb6.

I have two parameters that are causing a problem

1) Date time parameter
2)) a TEXT parameter

When excuting  I get a run time error. The problem appears to be the parameters themselves.

 The stored procedure and vb6 code examples is shown in code section.
stored procedure  is in SQL SERVER 2000

Basically could someone write the code for a vb6 to execute the following stored procedure (see code snippet).

Many thanks



The stored procedure is 
 
CREATE PROCEDURE InsertData
@guid      UNIQUEIDENTIFER,
@insertDate DATETIME,
@INSETTEXT TEXT
 
 
 
.Parameters.Append CreateParameter("@GUID", _
                                           DataTypeEnum.adguid?, _
                                           adParamInput)
    
 
    .Parameters.Append CreateParameter("@InsertDate", _
                                           DataTypeEnum.adDBDate?, _
                                           adParamInput)
 
        .Parameters.Append CreateParameter("@InsertText", _
                                                                       ??????, _
                                                                        adParamInput)
 
        .Parameters.Append CreateParameter("@Date_Saved", _
                                           DataTypeEnum.adDBDate, _
                                           adParamInput)
 
 
AS

Open in new window

peter3244Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
according to the documentation, is should be adLongVarChar, you might try dLongVarWChar instead.
0
 
RimvisCommented:
Try adLongVarChar
0
 
Anthony PerkinsCommented:
So I guess you don't need any more help with this question?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
peter3244Author Commented:
The sugestion didn't work. I have worked around the ;problem by doing the update in code. I guess nobody can provide me with a working example for text AND date fields. At this point I am very disallusioned with this site. Having paid a 200 pounds for access I didn't expect sarcastic comments like the one above.
0
 
peter3244Author Commented:
thanks for your help, As I said I have worked around the problem and I guess that the problem with the date must be to do with the server setings.
0
 
Anthony PerkinsCommented:
>>I guess nobody can provide me with a working example for text AND date fields.<<
You were given a solution which you chose to ignore for 4 days and only commented when I asked.

>>At this point I am very disallusioned with this site.<<
This site is a two-way street.  We volunteer our time with solutions with the condition that you provide feedback.  That is in the guidelines that you agree to every time you sign on.

>>The sugestion didn't work.<<
While we may be quite tech savy we do not read crystal balls.  We cannot see what ultimately will work for you or not.

>>I didn't expect sarcastic comments like the one above.<<
I am sorry you took it that way.  I was more then prepared to help you, but I was not going to do it if you had abandoned the question.

Next time, try and be a tad more proactive with your responses and you will get excellent help.
0
 
Anthony PerkinsCommented:
Incidentally, here is a link to the correct mappings:
Data Type Mapping
http://www.carlprothman.net/Technology/DataTypeMapping/tabid/97/Default.aspx

As you can see:
Text is in fact adLongVarChar (ntext is adLongVarWChar) and datetime is adDBTimeStamp

But there are other problems with the way you are setting up the parameters for the Stored Procedure and I would be surprised that you get it to work as is.  For example, your Stored Procedure contains 3 parameters, yet you appear to be setting up 4 parameters in your VB code, and there are other problems as well.
0
All Courses

From novice to tech pro — start learning today.