VBA + MS SQL
From: Piglet (piglet_at_box44.gnet.pl)
Date: 07/28/04
- Next message: Kevin Yu [MSFT]: "RE: recordset.sort Problems with data types"
- Previous message: Rasmus: "recordset.sort Problems with data types"
- Next in thread: Val Mazur: "Re: VBA + MS SQL"
- Reply: Val Mazur: "Re: VBA + MS SQL"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Jul 2004 09:04:22 +0200
I insert data into table in SQL Server 2000
I use ADODB.Command object with parameters like this:
Set CommandObj = CreateObject("ADODB.Command")
CommandObj.CommandText = "INSERT INTO TABLE1 VALUES (?,?)"
With CommandObj.Parameters
.Append CommandObj.CreateParameter("P1", 8, 1)
.Append CommandObj.CreateParameter("P2", 8, 1)
End With
CommandObj.Prepared=True
With CommandObj
.Parameters("P1")="QWERTY"
.Parameters("P2")="ABC"
.Execute
End With
and after executing that code the table in MS SQL looks like this:
P1 | P2
-------------
Q | A
and where the rest of those strings?
I have no problems with other data types (numeric,date etc)
Thank you for any help
-- Piglet
- Next message: Kevin Yu [MSFT]: "RE: recordset.sort Problems with data types"
- Previous message: Rasmus: "recordset.sort Problems with data types"
- Next in thread: Val Mazur: "Re: VBA + MS SQL"
- Reply: Val Mazur: "Re: VBA + MS SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|