Thread: How do I "Insert" using a type member?

How do I "Insert" using a type member?

From
"Ty Augustine"
Date:
Hi,
I'm a newbie to VB and SQL.  I have VB6 and SQL7.  I'm trying to insert
Strings that are members of a type into SQL,  This is what i've tried with
no success.  How do you do this? and how would I do this using a stored
procedure?

'SQL = "Insert SoftwarePackage(Name,Path,Size,nFiles) " _
'   & "Values('" & sw.cName & "'," _
'   & sw.cPath & "," _
'   & sw.sSize & "," _
'   & sw.hFiles & ")"



Re: How do I "Insert" using a type member?

From
John Steely
Date:
Ty,
    You were on the right track.  I'm assuming this is a string in your VB
app; if so, just quote the rest of the strings:

SQL = "Insert SoftwarePackage(Name,Path,Size,nFiles) " _
    & "value ('" & sw.cName & "', '" _
    & sw.cPath & "', '" _
    & sw.sSize & "', '" _
    & sw.hFiles & "')"
Just make sure Size and nFiles are char/varchar fields.

HTH
John Steely
DaVinci TWG


Ty Augustine wrote:
>
> Hi,
> I'm a newbie to VB and SQL.  I have VB6 and SQL7.  I'm trying to insert
> Strings that are members of a type into SQL,  This is what i've tried with
> no success.  How do you do this? and how would I do this using a stored
> procedure?
>
> 'SQL = "Insert SoftwarePackage(Name,Path,Size,nFiles) " _
> '   & "Values('" & sw.cName & "'," _
> '   & sw.cPath & "," _
> '   & sw.sSize & "," _
> '   & sw.hFiles & ")"