LargeBinaryStream and Sql dump restore

Chuck rwc1717 at shaw.ca
Tue Aug 5 09:24:45 CDT 2003


Hi Ruslan:
	More talk on the subject....
If one doesn't care about having the structure of the db in the sql dump file then you 
don't have to strip out the other stuff....insert the lines into the code that appear in 
captials

dim f,InDumpFile as FolderItem
dim b as LargeBinaryStreamMBS
dim filestream as TextOutPutStream
dim s as string
dim i,n as integer
dim little as boolean

//using the InDumpFile folderitem after Valentina dump as source


little = false
b =InDumpFile.OpenAsLargeBinaryStreamMBS(SystemDataForkNameMBS,false)
b.littleEndian = little

s = b.read(b(length)
b.close
b= Nil

for i = 1 to len(s)
	IF MID(S,I,6) = "INSERT" THEN
		n = Instr(i,s,");")
		u = trim(mid(s,i,n-i+1))
			//i = n + 2 this line is unnecessary 
		j = mDb.SQLExecute(u)
	END IF
next	
fileread.close
mDB.flush

...all restored!

BTW....Thanks for the compliment...I will put the star on my forehead/

Thanks Chuck




More information about the Valentina mailing list