The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: xPLMediaNet - Need some .net oledb help please


  • Subject: Re: xPLMediaNet - Need some .net oledb help please
  • From: Tom Van den Panhuyzen <tomvdp@xxxxxxxxx>
  • Date: Tue, 26 Jul 2005 13:19:31 +0200
  • References: <42e61580.05de8fc9.720a.196eSMTPIN_ADDED@mx.gmail.com>

Normally you don't need to specify autonums in insert statements - must be
something else there.
(but I tend to avoid autonums)
I think the easiest is to loop over the records and call the update
yourself. It is what the DA would do for you anyway.
Dim C as OleDbCommand = New OleDbCommand("update Music set
Path=@NewPath
where Path=@OldPath", dbs)
C.Parameters.Add("NewPath", OleDbType.VarChar, 255)
C.Parameters.Add("OldPath", OleDbType.VarChar, 255)
For x As Long = 0 To DT.Rows.Count - 1
np = FullPath & Mid(DT.Rows(x).Item(0), Len(OldFullPath) + 1)
if np<>FullPath then
C.Parameters("NewPath").Value = np
C.Parameters("OldPath").Value = FullPath
C.ExecuteNonQuery
end if
Next
Typed in email editor so will contain errors... (+ not sure how the
FullPath and NewPath correlate)
Cheers,
Tom


On 7/26/05, Tony Tofts <tony@xxxxxxx> wrote:
>
> > Not too bothered about oracle, so if mysql/mssql support
> > autonumber then I'll change over to that.
>
> Turns out the executenonquery needs all fields to be specified in the
> insert
> clause, and of course if specified it falls over because it can't
update
> the
> autonumber field. Seems like a catch22...
>
> Although I can program around it using a dataset, I think it's more
> efficient to go back to the md5hash
>
> Regards
> Tony
>
>
>
> xPL Links: http://www.xplproject.org.uk http://www.xplhal.com
> http://www.xpl.myby.co.uk
> To Post a Message: ukha_xpl@xxxxxxx
> To Subscribe: ukha_xpl-subscribe@xxxxxxx
> To Unsubscribe: ukha_xpl-unsubscribe@xxxxxxx
>
>
>  ------------------------------
> YAHOO! GROUPS LINKS
>
>
>    - Visit your group "ukha_xpl<http://groups.yahoo.com/group/ukha_xpl>"
>    on the web.
>     - To unsubscribe from this group, send an email to:
>   
ukha_xpl-unsubscribe@xxxxxxx<ukha_xpl-unsubscribe@xxxxxxx?subject=Unsubscribe>
>     - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>    Service <http://docs.yahoo.com/info/terms/>.
>
>
>  ------------------------------
>


[Non-text portions of this message have been removed]



xPL Links: http://www.xplproject.org.uk http://www.xplhal.com http://www.xpl.myby.co.uk
To Post a Message: ukha_xpl@xxxxxxx
To Subscribe:  ukha_xpl-subscribe@xxxxxxx
To Unsubscribe:  ukha_xpl-unsubscribe@xxxxxxx

xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.