Jump to content

RTollison

Members
  • Content Count

    112
  • Joined

  • Last visited

Everything posted by RTollison

  1. RTollison

    Copy MSSQL Database

    i have a program (old) that creates a backup of a database then restores that database with a different name. it keeps all the users/stored procs/whatever. Is there a newer/better way to create a copy of an MSSQL database? Currently support team is saying that it takes a long time to finish.
  2. RTollison

    Copy MSSQL Database

    thanks for the info. i suspect it is the actual servers themselves. space available, disk cache and memory seem to be possible bottlenecks and my program is doing it correctly still. written back for sql 2005/2008 era. sounds like it is still viable solution now.
  3. RTollison

    Copy MSSQL Database

    generally speaking 10GB+ SQL server range from 2008r2 and up. Client last week had 42GB on SQL 2012 and it took about 40-45 minutes to complete the backup/restore process. This is run on the actual server while it is in use on the production database. and lots of times i see the SQL Server app using up 90% of the memory on those servers. sometimes i force clients to exit applications using the database then restart the SQL service, which drops the memory usage and then i run my app. < 20-30 minutes for a particular client who indicated that it had been running for 1.5 hrs.
  4. RTollison

    Copy MSSQL Database

    in my code i use BACKUP DATABASE PRODUCTION TO DISK = C:\TEMP\TESTDATABASE.BAK WITH INIT then RESTORE DATABASE TESTDATABASE FROM DISK = C:\TEMP\TESTDATABASE.BAK WITH MOVE "logicalname" TO "location\testdatabase.mdf", REPLACE same for ldf file Is the with INIT slower than the with FORMAT?
  5. RTollison

    Copy MSSQL Database

    interesting, but i don't have complete trust in support to manually do all that so i use delphi with adoconnection, adocommand to process it all to ensure the names never get mixed up and overwritten. hoping for a better component or option to create the copy (test database from a production database)
  6. RTollison

    virtualstringtree and checkboxes

    NOTE: Found issue. No replies needed. Except for scolding.... I had a project that was working with the VST and checkboxes showing up. i had to move project to a new pc and get the virtual components installed. i can now compile project without errors but lost something along the way. i used this code to add the nodes with a check box: function AddVSTObject(AVST: TCustomVirtualStringTree; ANode: PVirtualNode; AObject: TObject): PVirtualNode; var Data: PClassRoomData; begin Result:=AVST.AddChild(ANode); Result.CheckType := ctTriStateCheckBox; AVST.ValidateNode(Result,False); Data:=AVST.GetNodeData(Result); Data^.FObject:=AObject; end; It will display the tree with all the info but the checkboxes do not display. i checked the properties of the vst and found nothing related to checkboxes. so any ideas as to what i could check to get the checkboxes to show up?
  7. RTollison

    virtualstringtree and checkboxes

    well crap, now i find the miscoptions and checksupport. sorry for post and thanks
  8. RTollison

    virtualstringtree and checkboxes

    old program shows the checkbox but new compiled program with gui changes not related to tree does not show checkbox
  9. RTollison

    array

    i have multiple text files (not a lot of records < 3-4K) that i need to search thru finding matches based upon user input. example: Date, Time, Descript_1, Value_1, Descript_2, Value_2, Descript_3, Value 3, Descript_4, Value_4 01/01/24,08:00:00,Springs, 25, Nuts, 14, Bolts, 75, washers, 207 01/01/24,08:00:15,Springs, 25,Bolts, 35,Nuts,1,washers,12 and so on. now in the past i have loaded up the files to SQL tables and then search for the matches. works ok but now user wants to enter all of the search parameters into a file and do all the searching at once. again not a big deal since i can again read and search. Not that it takes a long time but his system isn't that up to speed and IS rather slow at searching. SO now i want to change the process. I want to create a record array of the date, time, description and values. then just read his search input file (without creating a new record array) and just do a search directly on the record arrays. I have searched and found the TList but they only show a single column matching whereas i need to match the descript_# and value_# for each pairing. like the descript_1 = Springs and value_1=25, then compare the next group because they all have to match in the same sequence. 1's have to match, 2's have to match, 3's have to match and the 4's i am trying to understand TList but so far am falling short type TMyRec = packed record dt : Tdate; tm " Ttime; d1 : string; v1 : integer; d2 : string; v2 : integer; d3 : string; v3 : integer; d4 : string; v4 : integer; end;
  10. RTollison

    idhttp.post idcompressorzlib

    i have seen lots of examples for get and decompress of data but nothing really for compress and post. after creating the idCompressor and assigning it to the idHTTP what needs to happen to compress the sRequest FileStream? sRequest and sResponse are TFileStreams ... idHTTP := TidHTTP.Create; idCompressor := TidCompressorZLib.Create(idHTTP); idHTTP.Compressor := idCompressor; idHTTP.ConnectTimeout := 60000; idHTTP.HTTPOptions := [hoKeepOrigProtocol,hoForceEncodeParams]; idHTTP.ReadTimeout := 60000; idHTTP.HandleRedirects := True; idHTTP.IOHandler := SSLHandler; idHTTP.Request.BasicAuthentication := false; idHTTP.Request.CustomHeaders.Values['Authorization'] := 'Bearer ' + _token; idHTTP.Request.ContentType := string(aContentType); idHTTP.Request.CharSet := string(aCharSet); idHTTP.Post(trim(string(aURL)), sRequest, sResponse);
  11. RTollison

    idhttp.post idcompressorzlib

    cool thanks. probably why i never found sample code. but i did see the zlib examples and will go that route. gzip
  12. RTollison

    RAD 10.2 Startup Script Errors

    Not sure it has anything to do with errors or not but i had learn Jenkins which requires Java 17+ for latest version. about a month or so after that i needed to change delphi dll. however, when i start RAD Studio i get like 22 errors on the startup screen all pretty much the same format. An error has occurred in the script on this page. blah blah blah URL: https://...blah.../js/jquery/jquery.min.js Also around this time our IT dept locked up a bunch more stuff. I have JAVA 21.0.2 installed. i searched for these errors but nothing came up. is it my pc/java or is it something else running interference?
  13. Trying to figure out how to add a shape (rectangle, small) to fast report page. SO user clicks on answers (test page) and then need to put a square/circle/whatever to indicate their answer to the question. questions random the answers (A, B, C, D) so the shape object would not be fixed location.
  14. RTollison

    DCPCRYPTO blowfish

    Trying to sync up a .Net implementation of blowfish and was not syncing up so i added to the dcpcrypto for blowfish.selftest i added a new key/data items. the key3, indata3 and outdata3 then copied the code for encrypt/decrypt and then verify the in/out matched. but my data2 is getting stopped at 8 bytes and not the full 16 in the var section. so the EncryptECB is taking it off but i am not sure why. is encryptecb set to only handle 8 bytes/16wide? class function TDCP_blowfish.SelfTest: boolean; const Key1: array[0..7] of byte= ($00,$00,$00,$00,$00,$00,$00,$00); Key2: array[0..7] of byte= ($7C,$A1,$10,$45,$4A,$1A,$6E,$57); InData1: array[0..7] of byte= ($00,$00,$00,$00,$00,$00,$00,$00); InData2: array[0..7] of byte= ($01,$A1,$D6,$D0,$39,$77,$67,$42); OutData1: array[0..7] of byte= ($4E,$F9,$97,$45,$61,$98,$DD,$78); OutData2: array[0..7] of byte= ($59,$C6,$82,$45,$EB,$05,$28,$2B); Key3: array[0..31] of byte= ($ff,$8a,$0b,$85,$ff,$a9,$14,$d1,$b5,$61,$df,$31,$1f,$94,$f5,$aa,$55,$08,$b9,$ad,$49,$0a,$ba,$df,$e3,$57,$00,$37,$13,$fc,$79,$d0); InData3: array[0..15] of byte= ($54,$68,$69,$73,$20,$69,$73,$20,$61,$20,$74,$65,$73,$74,$21,$21); OutData3: array[0..15] of byte= ($e2,$77,$9b,$17,$b9,$e4,$2b,$ec,$b7,$a3,$7c,$21,$c0,$d6,$18,$93); var Cipher: TDCP_blowfish; Data: array[0..7] of byte; Data2: array[0..15] of byte; begin FillChar(Data, SizeOf(Data), 0); Cipher:= TDCP_blowfish.Create(nil); Cipher.Init(Key1,Sizeof(Key1)*8,nil); Cipher.EncryptECB(InData1,Data); Result:= boolean(CompareMem(@Data,@OutData1,Sizeof(Data))); Cipher.Reset; Cipher.DecryptECB(Data,Data); Result:= boolean(CompareMem(@Data,@InData1,Sizeof(Data))) and Result; Cipher.Burn; Cipher.Init(Key2,Sizeof(Key2)*8,nil); Cipher.EncryptECB(InData2,Data); Result:= boolean(CompareMem(@Data,@OutData2,Sizeof(Data))) and Result; Cipher.Reset; Cipher.DecryptECB(Data,Data); Result:= boolean(CompareMem(@Data,@InData2,Sizeof(Data))) and Result; Cipher.Burn; Cipher.Free; FillChar(Data2, SizeOf(Data2), 0); Cipher:= TDCP_blowfish.Create(nil); Cipher.Init(Key3,Sizeof(Key3)*8,nil); Cipher.EncryptECB(InData3,Data2); Result:= boolean(CompareMem(@Data2,@OutData3,Sizeof(Data2))) and Result; Cipher.Reset; Cipher.DecryptECB(Data2,Data2); Result:= boolean(CompareMem(@Data2,@InData3,Sizeof(Data2))) and Result; Cipher.Burn; Cipher.Free; end; procedure TDCP_blowfish.EncryptECB(const InData; var OutData); var xL, xR: DWord; begin if not fInitialized then raise EDCP_blockcipher.Create('Cipher not initialized'); xL:= Pdword(@InData)^; xR:= Pdword(longword(@InData)+4)^; xL:= ((xL and $FF) shl 24) or ((xL and $FF00) shl 8) or ((xL and $FF0000) shr 8) or ((xL and $FF000000) shr 24); xR:= ((xR and $FF) shl 24) or ((xR and $FF00) shl 8) or ((xR and $FF0000) shr 8) or ((xR and $FF000000) shr 24); xL:= xL xor PBox[0]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[1]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[2]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[3]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[4]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[5]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[6]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[7]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[8]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[9]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[10]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[11]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[12]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[13]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[14]; xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[15]; xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[16]; xR:= xR xor PBox[17]; xL:= ((xL and $FF) shl 24) or ((xL and $FF00) shl 8) or ((xL and $FF0000) shr 8) or ((xL and $FF000000) shr 24); xR:= ((xR and $FF) shl 24) or ((xR and $FF00) shl 8) or ((xR and $FF0000) shr 8) or ((xR and $FF000000) shr 24); Pdword(@OutData)^:= xR; Pdword(longword(@OutData)+4)^:= xL; end;
  15. RTollison

    DCPCRYPTO blowfish

    thank you for the info/input. the background on this is that way back in 2014 or prior a dll was create using the DCP Crypto libraries. the blowfish cipher was selected for encrypt/decrypt functions and has been in use for all clients. now a .Net dev was asking me to give him a hand in validating that his .net/c# version is working/matching. he has a quick access point in his code to just encrypt/decrypt the indata value. so we added his test to the selftest for verification. well the first 8 matched but we wanted to determine why the last 8 were not matching to his code. i guess trying to shortcut the testing process was a little short sighted on my part. i will just let it encrypt/decrypt the same string he is testing. Thank you again...
  16. RTollison

    activex word97 word

    I have a very old project for interfacing with Word. Originally done when i had Word 97 and 2003 later. Created dot file in 97-03 format and all worked great. now i am adding some extra stuff to the old project BUT with my new activex/dll i get a different format when loading up the old dot files. paragraph spacing, default font. it's like it doesn't care about the dot being in an older format. but when i revert back to the original compiled activex/dll it works. same font, same paragraph spacing. what would i look for as the trigger for old 97-03 format versus new format. the dot has times font but when i load it up using new compiled dll i get Calibri (default for new session in WORD) but the older dll will keep it as Times.
  17. RTollison

    activex word97 word

    reason for the older one is that we committed to that version from the start and now our clients have 2000+ documents (for all clients not just one) and we would be the ones to reformat the dot to a dotx and update dl. so for now we will use old so that our clients will not overwhelm our support teams.
  18. RTollison

    activex word97 word

    i think you helped me answer my stupid question. in 10.2 i do not have the Office 2000 options turned on.
  19. RTollison

    activex word97 word

    <DCCReference Include="uMain.pas"> <CoClasses>Word</CoClasses> </DCCReference> ... lines above in the include for the .dproj for the project not my original project but handed off to me for some desired updates/features.
  20. RTollison

    activex word97 word

    interface uses ActiveX; // *********************************************************************// // Declaration of Enumerations defined in Type Library // *********************************************************************// // Constants for enum WdMailSystem type WdMailSystem = TOleEnum; const wdNoMailSystem = $00000000; wdMAPI = $00000001; wdPowerTalk = $00000002; wdMAPIandPowerTalk = $00000003; // Constants for enum WdTemplateType type WdTemplateType = TOleEnum; const wdNormalTemplate = $00000000; wdGlobalTemplate = $00000001; wdAttachedTemplate = $00000002; // Consta ......
  21. RTollison

    activex word97 word

    // *********************************************************************// // Declaration of CoClasses defined in Type Library // (NOTE: Here we map each CoClass to its Default Interface) // *********************************************************************// Word = IWord; // *********************************************************************// // Interface: IWord // Flags: (4416) Dual OleAutomation Dispatchable // GUID: {4261D89B-82E0-4ED7-8F71-BCEF8E6E267E} // *********************************************************************// IWord = interface(IDispatch) ['{4261D89B-82E0-4ED7-8F71-BCEF8E6E267E}'] function OpenSession(var ASessionID: Integer): Integer; safecall; function CloseSession(ASessionID: Integer): Integer; safecall; function ReleaseSession(ASessionID: Integer): Integer; safecall; function SessionCount: Integer; safecall; function OpenFile(ASessionID: Integer; AFilePath: OleVariant; var AFileID: Integer): Integer; safecall; ....
  22. RTollison

    activex word97 word

    original delphi 5 new delphi 10.2 word ole automation - original was word 2003 new is word 365 i have been trying different things in the dll and found that if I change all calls of FSession.Word.Selection.Paste() to FSession.Word.Selection.PasteAndFormat(WdRecoveryType.wdFormatOriginalFormatting); it formats the same. but my page layout is off because original dot is 1 page and the newly created document is 2 pages. the last part of the dot is a salutation type text but instead of bottom of the document it goes to the top of the next page. but overall the text/spacing "seems" to be the same.
  23. Not sure how to go about this but in my in-house program, not for client use, i create a process to run a command for each file i process. varies depending on selection. 1 - 2500. However, the antivirus has to scan/test each create process that is run in a thread. so if i say spin up 50 threads at a time to process all 2500 files it takes forever, 12-14 hours. I worked with our IT dept to get the command that is running cleared and my program for spinning up the threads to run it. But I watch the task manager details and every time i spin up a thread then the AntiVirus inspects it, so what used to take like 10 minutes is now hours long. after begging an IT to whitewash the create process (solid no way on that) she suggested i look into creating a com object that they might whitewash to see (testing phase) if it would be bypassed by the AV. we don't know if it will help. i said it sounded like what my program is doing now with the exe. but IT will not move on this until i try a COM object that just runs the command (hopefully) without using create process. maybe use the CMD package added in the delphi add-ins. any help/ideas would be greatly appreciated, even the crazy ones. "Have you ran check disk to see if there are any problems?" nothing changed...
  24. Dlg := Sender as TFileOpenDialog; if Succeeded(SHCreateItemFromParsingName(PWideChar(WideString('\\tsclient')), nil, IShellItem, DefFolder)) then Is there a way to for that command to work when parsing tsclient. if i set it to 'C:\myfolder' it works but when i rdp to server (with drives shared and are accessible) when i set the string to '//tsclient' it fails. I have searched for shcreateitemfromparsingname and tsclient but can't find anything
  25. RTollison

    tfileopendialog tsclient on folder changing event

    well hell, after rebooting server due to the annoying updates need installing message, i rebooted it and let it install update. now it is working correctly.
×