--____LPHMXLZMXOMRLFKSEJCW____
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

I am trying to save some rtf code from an rtf field to a TEXT field on =
SQL2000.

The code I have been playing with (thanks to Nick for the originally =
supplied code!) is:
Sub DoByteConversion()

Dim pBytStuff As Byte() =3D StringToArray(Rtxt_readme.Rtf) =
'convert rtf field to byte array

Dim pDBNConnection As OleDbConnection
Dim pDBCCommand As OleDbCommand
pDBNConnection =3D New OleDbConnection
pDBNConnection.ConnectionString =3D Globals.udl0Val 'take udk =
connection from Globals Class
Call pDBNConnection.Open()
If (pDBNConnection.State =3D ConnectionState.Open) Then
pDBCCommand =3D pDBNConnection.CreateCommand
pDBCCommand.CommandText =3D "UPDATE TestsConfig Set ReadMe =3D =
@bits Where Type =3D '" & TestSelected & "'"
pDBCCommand.CommandTimeout =3D 20
Call addParameter(pDBCCommand, "bits", pBytStuff)
If (pDBCCommand.ExecuteNonQuery() > 0) Then
'OPERATION WAS FINE!
End If
End If
End Sub
Public Function getOleDbType(ByVal iType As Type) As OleDbType
If (iType Is GetType(String)) Then
Return OleDbType.VarChar
ElseIf (iType Is GetType(Integer)) Then
Return OleDbType.Integer
ElseIf (iType Is GetType(Boolean)) Then
Return OleDbType.Boolean
ElseIf (iType Is GetType(Date)) Then
Return OleDbType.Date
ElseIf (iType Is GetType(Char)) Then
Return OleDbType.Char
ElseIf (iType Is GetType(Decimal)) Then
Return OleDbType.Decimal
ElseIf (iType Is GetType(Double)) Then
Return OleDbType.Double
ElseIf (iType Is GetType(Single)) Then
Return OleDbType.Single
ElseIf (iType Is GetType(Byte())) Then
Return OleDbType.Binary
ElseIf (iType Is GetType(Guid)) Then
Return OleDbType.Guid
End If
End Function

Public Sub addParameter(ByVal iCommand As OleDbCommand, ByVal =
iParameter As String, _
ByVal iValue As Object)

If (iCommand.CommandText.IndexOf(iParameter) <> -1) Then
Dim pODPParameter As OleDbParameter =3D _
iCommand.Parameters.Add(iParameter, getOleDbType(iValue.GetType=
))
pODPParameter.Value =3D iValue
End If
End Sub

However when I run this it I just get an unhandled exception in Data.Dll

Any ideas would be appreciated!

Cheers
Adam

--____LPHMXLZMXOMRLFKSEJCW____
Content-Type: multipart/related; boundary="____WHPEPQYSAQXEHDGESJXG____"


--____WHPEPQYSAQXEHDGESJXG____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"=
>
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR></HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 8pt Tahoma; COLOR: #000000">
<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am trying to save some rtf code from an rtf field to&nbsp;a TEXT =
field on SQL2000.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The code I have been playing with (thanks to Nick for the originally =
supplied code!) is:</DIV>
<DIV>Sub DoByteConversion()</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pBytStuff As Byte() =
=3D StringToArray(Rtxt_readme.Rtf) 'convert rtf field to byte array</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pDBNConnection As =
OleDbConnection<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim =
pDBCCommand As OleDbCommand<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
pDBNConnection =3D New OleDbConnection<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; pDBNConnection.ConnectionString =3D Globals.udl0Val 'take udk =
connection from Globals Class<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
Call pDBNConnection.Open()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
If (pDBNConnection.State =3D ConnectionState.Open) Then<BR>&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pDBCCommand =3D =
pDBNConnection.CreateCommand<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; pDBCCommand.CommandText =3D "UPDATE TestsConfig =
Set ReadMe =3D @bits Where Type =3D '" &amp; TestSelected &amp; "'"<BR>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pDBCCommand.=
CommandTimeout =3D 20<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; Call addParameter(pDBCCommand, "bits", pBytStuff)<BR>&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (pDBCComma=
nd.ExecuteNonQuery() &gt; 0) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'OPERATION WAS =
FINE!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
End If<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp=
;&nbsp; End Sub<BR>&nbsp;&nbsp;&nbsp; Public Function getOleDbType(ByVal =
iType As Type) As OleDbType<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
If (iType Is GetType(String)) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return OleDbType.VarChar<BR>&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf (iType Is GetType(Integer)) Then<BR>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return =
OleDbType.Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf =
(iType Is GetType(Boolean)) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; Return OleDbType.Boolean<BR>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; ElseIf (iType Is GetType(Date)) Then<BR>&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return OleDbType.Da=
te<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf (iType Is =
GetType(Char)) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; Return OleDbType.Char<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; ElseIf (iType Is GetType(Decimal)) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return OleDbType.Decimal<BR>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf (iType Is GetType(Double)) =
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Return OleDbType.Double<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf (iType Is GetType(Single)) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return OleDbType.Single<BR>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf (iType Is GetType(Byte())) Then<BR>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return =
OleDbType.Binary<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf =
(iType Is GetType(Guid)) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp; Return OleDbType.Guid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; End Function</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Public Sub addParameter(ByVal iCommand As =
OleDbCommand, ByVal iParameter As String, _<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ByVal iValue =
As Object)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (iCommand.CommandText.In=
dexOf(iParameter) &lt;&gt; -1) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pODPParameter As OleDbParameter =3D =
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
iCommand.Parameters.Add(iParameter, getOleDbType(iValue.GetType))<BR>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pODPParameter.=
Value =3D iValue<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End =
If<BR>&nbsp;&nbsp;&nbsp; End Sub</DIV>
<DIV>&nbsp;</DIV>
<DIV>However when I run this it I just get an unhandled exception in =
Data.Dll</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any ideas would be appreciated!</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers</DIV>
<DIV>Adam</DIV></BODY></HTML>

--____WHPEPQYSAQXEHDGESJXG____--

--____LPHMXLZMXOMRLFKSEJCW____--

Re: Saving rtf using binary and oledb by Sahil

Sahil
Fri Oct 22 10:02:11 CDT 2004

This is a multi-part message in MIME format.

------=_NextPart_000_0022_01C4B826.94B93410
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

What's your table structure for TestsConfig ?
What kinda database?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik

"Adam Maltby" <adamm@frfl.co.uk> wrote in message =
news:OSnbcZCuEHA.4040@TK2MSFTNGP09.phx.gbl...
Hi,

I am trying to save some rtf code from an rtf field to a TEXT field on =
SQL2000.

The code I have been playing with (thanks to Nick for the originally =
supplied code!) is:
Sub DoByteConversion()

Dim pBytStuff As Byte() =3D StringToArray(Rtxt_readme.Rtf) =
'convert rtf field to byte array

Dim pDBNConnection As OleDbConnection
Dim pDBCCommand As OleDbCommand
pDBNConnection =3D New OleDbConnection
pDBNConnection.ConnectionString =3D Globals.udl0Val 'take udk =
connection from Globals Class
Call pDBNConnection.Open()
If (pDBNConnection.State =3D ConnectionState.Open) Then
pDBCCommand =3D pDBNConnection.CreateCommand
pDBCCommand.CommandText =3D "UPDATE TestsConfig Set ReadMe =
=3D @bits Where Type =3D '" & TestSelected & "'"
pDBCCommand.CommandTimeout =3D 20
Call addParameter(pDBCCommand, "bits", pBytStuff)
If (pDBCCommand.ExecuteNonQuery() > 0) Then
'OPERATION WAS FINE!
End If
End If
End Sub
Public Function getOleDbType(ByVal iType As Type) As OleDbType
If (iType Is GetType(String)) Then
Return OleDbType.VarChar
ElseIf (iType Is GetType(Integer)) Then
Return OleDbType.Integer
ElseIf (iType Is GetType(Boolean)) Then
Return OleDbType.Boolean
ElseIf (iType Is GetType(Date)) Then
Return OleDbType.Date
ElseIf (iType Is GetType(Char)) Then
Return OleDbType.Char
ElseIf (iType Is GetType(Decimal)) Then
Return OleDbType.Decimal
ElseIf (iType Is GetType(Double)) Then
Return OleDbType.Double
ElseIf (iType Is GetType(Single)) Then
Return OleDbType.Single
ElseIf (iType Is GetType(Byte())) Then
Return OleDbType.Binary
ElseIf (iType Is GetType(Guid)) Then
Return OleDbType.Guid
End If
End Function

Public Sub addParameter(ByVal iCommand As OleDbCommand, ByVal =
iParameter As String, _
ByVal iValue As Object)

If (iCommand.CommandText.IndexOf(iParameter) <> -1) Then
Dim pODPParameter As OleDbParameter =3D _
iCommand.Parameters.Add(iParameter, =
getOleDbType(iValue.GetType))
pODPParameter.Value =3D iValue
End If
End Sub

However when I run this it I just get an unhandled exception in =
Data.Dll

Any ideas would be appreciated!

Cheers
Adam
------=_NextPart_000_0022_01C4B826.94B93410
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 8pt Tahoma; COLOR: #000000"=20
bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>What's your table structure for =
TestsConfig=20
?<BR>What kinda database?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR>- Sahil Malik<BR><A=20
href=3D"http://www.dotnetjunkies.com/weblog/sahilmalik">http://www.dotnet=
junkies.com/weblog/sahilmalik</A><BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Adam Maltby" &lt;<A=20
href=3D"mailto:adamm@frfl.co.uk">adamm@frfl.co.uk</A>&gt; wrote in =
message <A=20
=
href=3D"news:OSnbcZCuEHA.4040@TK2MSFTNGP09.phx.gbl">news:OSnbcZCuEHA.4040=
@TK2MSFTNGP09.phx.gbl</A>...</DIV>
<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am trying to save some rtf code from an rtf field to&nbsp;a =
TEXT field=20
on SQL2000.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The code I have been playing with (thanks to Nick for the =
originally=20
supplied code!) is:</DIV>
<DIV>Sub DoByteConversion()</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pBytStuff As =
Byte() =3D=20
StringToArray(Rtxt_readme.Rtf) 'convert rtf field to byte array</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pDBNConnection As=20
OleDbConnection<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim =
pDBCCommand=20
As OleDbCommand<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
pDBNConnection =3D=20
New OleDbConnection<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
pDBNConnection.ConnectionString =3D Globals.udl0Val 'take udk =
connection from=20
Globals Class<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Call=20
pDBNConnection.Open()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If =

(pDBNConnection.State =3D ConnectionState.Open)=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
pDBCCommand =3D=20
=
pDBNConnection.CreateCommand<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;=20
pDBCCommand.CommandText =3D "UPDATE TestsConfig Set ReadMe =3D @bits =
Where Type =3D=20
'" &amp; TestSelected &amp;=20
=
"'"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
pDBCCommand.CommandTimeout =3D=20
=
20<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Call=20
addParameter(pDBCCommand, "bits",=20
=
pBytStuff)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
If (pDBCCommand.ExecuteNonQuery() &gt; 0)=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;=20
'OPERATION WAS=20
=
FINE!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
End If<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End=20
If<BR>&nbsp;&nbsp;&nbsp; End Sub<BR>&nbsp;&nbsp;&nbsp; Public Function =

getOleDbType(ByVal iType As Type) As=20
OleDbType<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (iType Is=20
GetType(String))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.VarChar<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Integer))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Boolean))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Boolean<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Date))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Date<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Char))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Char<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Decimal))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Decimal<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Double))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Double<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Single))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Single<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Byte()))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Binary<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
ElseIf=20
(iType Is GetType(Guid))=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Return OleDbType.Guid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
End=20
If<BR>&nbsp;&nbsp;&nbsp; End Function</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Public Sub addParameter(ByVal iCommand As=20
OleDbCommand, ByVal iParameter As String,=20
=
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
ByVal iValue As Object)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If=20
(iCommand.CommandText.IndexOf(iParameter) &lt;&gt; -1)=20
=
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; Dim=20
pODPParameter As OleDbParameter =3D=20
=
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
iCommand.Parameters.Add(iParameter,=20
=
getOleDbType(iValue.GetType))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;=20
pODPParameter.Value =3D =
iValue<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End=20
If<BR>&nbsp;&nbsp;&nbsp; End Sub</DIV>
<DIV>&nbsp;</DIV>
<DIV>However when I run this it I just get an unhandled exception in=20
Data.Dll</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any ideas would be appreciated!</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers</DIV>
<DIV>Adam</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0022_01C4B826.94B93410--


Re: Saving rtf using binary and oledb by Adam

Adam
Fri Oct 22 11:37:43 CDT 2004


--____LPHMXLZMXOMRLFKSEJCW____
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

sql2000
Fields
Q,A,B,C,D,Correct,Expired =3D VarChar 100
readme (rtf) =3D Text

Cheers
Adam

--____LPHMXLZMXOMRLFKSEJCW____
Content-Type: multipart/related; boundary="____WHPEPQYSAQXEHDGESJXG____"


--____WHPEPQYSAQXEHDGESJXG____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"=
>
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR></HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 8pt Tahoma; COLOR: #000000">
<DIV>sql2000</DIV>
<DIV><STRONG>Fields</STRONG></DIV>
<DIV>Q,A,B,C,D,Correct,Expired =3D VarChar 100</DIV>
<DIV>readme (rtf) =3D Text</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers</DIV>
<DIV>Adam</DIV></BODY></HTML>

--____WHPEPQYSAQXEHDGESJXG____--

--____LPHMXLZMXOMRLFKSEJCW____--

Re: Saving rtf using binary and oledb by Sushil

Sushil
Fri Oct 22 14:41:47 CDT 2004

This is a multi-part message in MIME format.

------=_NextPart_000_0098_01C4B834.7EACF1D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Some more questions:
1. In the given schema, the column name - "Type" doesn't appear; but it =
appears in the update statement
UPDATE TestsConfig Set ReadMe =3D @bits Where Type =3D '" & TestSelected =
& "'"
2. Also, note that "Explicit conversion from data type binary to text is =
not allowed."
3. TestSelected doesnt appear in the code snippet, i assume its =
initialized some where else.
4. If you have already tried the above, can you send the stack trace to =
know where exactly this is failing.=20
--=20
HTH,
Sushil Chordia.
This posting is provided "AS IS" with no warranties, and confers no =
rights.
"Adam Maltby" <adamm@frfl.co.uk> wrote in message =
news:eZd$1VFuEHA.948@tk2msftngp13.phx.gbl...
sql2000
Fields
Q,A,B,C,D,Correct,Expired =3D VarChar 100
readme (rtf) =3D Text

Cheers
Adam
------=_NextPart_000_0098_01C4B834.7EACF1D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 8pt Tahoma; COLOR: #000000"=20
bgColor=3D#e6e6e6>
<DIV><FONT face=3DArial size=3D2>Some more questions:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>1. In the given schema, the column name =
- "Type"=20
doesn't appear; but it appears in the update statement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>UPDATE TestsConfig Set ReadMe =3D @bits =
Where Type =3D=20
'" &amp; TestSelected &amp; "'"<BR></FONT><FONT face=3DArial =
size=3D2><FONT=20
face=3DArial size=3D2>2. Also, note that "Explicit conversion from data =
type binary=20
to text is not allowed."</FONT></DIV></FONT>
<DIV><FONT face=3DArial size=3D2>3. TestSelected&nbsp; doesnt appear in =
the code=20
snippet, i assume its initialized some where else.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>4. If you have already tried the above, =
can you=20
send the stack trace to know where exactly this is failing. =
</FONT></DIV>
<DIV>-- <BR>HTH,<BR>Sushil Chordia.<BR>This posting is provided "AS IS" =
with no=20
warranties, and confers no rights.</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Adam Maltby" &lt;<A=20
href=3D"mailto:adamm@frfl.co.uk">adamm@frfl.co.uk</A>&gt; wrote in =
message <A=20
=
href=3D"news:eZd$1VFuEHA.948@tk2msftngp13.phx.gbl">news:eZd$1VFuEHA.948@t=
k2msftngp13.phx.gbl</A>...</DIV>
<DIV>sql2000</DIV>
<DIV><STRONG>Fields</STRONG></DIV>
<DIV>Q,A,B,C,D,Correct,Expired =3D VarChar 100</DIV>
<DIV>readme (rtf) =3D Text</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers</DIV>
<DIV>Adam</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0098_01C4B834.7EACF1D0--