Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2007, 11:02 AM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default type clash: sql_variant is incompatible with text

How do I create a command object( in VBA) to a Stored Procedure that has a SQL DataType "Text" as one of the arguments

My SP:

CREATE PROCEDURE dbo.Spacs_AddNotes

@Spac_Name VARCHAR(50),
@Dt DATETIME,
@Notes Text

AS

INSERT INTO Spacs_Notes
(name_id, dt, notes)
SELECT N.Name_Id,@Dt,@Notes
    FROM Spacs_Names N
    WHERE Spac_Name = @Spac_Name
GO

And my VBA Code

 Dim notes As ADODB.Parameter
   Set notes = cmdDb.CreateParameter("notes", adVariant, adParamInput, , Null)
   cmdDb.Parameters.Append notes

cmdDb.Parameters.item(2) = Cells(i, 6).Value
        cmdDb.Execute

Cells(i,6) has "text test 123 test" in it in excel.

I get a "Operand type clash: sql_variant is incompatible with text" error.

Thanks!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Incompatible version of the RPC stub. K_JEYAKUMAR Beginning VB 6 0 October 26th, 2005 08:59 AM
Error:: Incompatible version of the RPC Stub" chiefouko Beginning VB 6 1 October 26th, 2005 08:52 AM
java.lang.VerifyError:Incompatible object argument pashah72 Apache Tomcat 0 June 1st, 2005 08:37 AM
Concatenate TEXT Type Value 1kHz SQL Language 5 December 31st, 2004 01:29 AM
Content-type = text/html tarran C# 3 December 5th, 2004 08:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.