Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making PHDBase work under ExecScript()
Message
De
09/07/2007 12:04:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/07/2007 16:08:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01238479
Message ID:
01238640
Vues:
18
>I am completing the last step of a full migration of a VFP application into .NET. That one was a robot application which includes, among other things, the indexation of content with the use of PHDBase. Now that everything is in .NET, I need to avoid all kinds of VFP native stuff. Everything I needed so far, in regards to executing VFP commands, have been converted by the use of ExecScript(). However, the loading of a FLL does not seem to be supported. I have something like this presently:
>
>
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SET SAFETY OFF"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SET EXCLUSIVE OFF"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""CLOSE ALL"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""USE " + lcLocalDBF + "Thread IN 0"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SELECT Thread"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SET LIBRARY TO D:\WWW\PHDBASE ADDITIVE"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""PHD('MSGLEVEL NONE')"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""PHD('IXAUTO OFF')"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""USE " + lcLocalDBF + "Thread IN 0"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SELECT Thread"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SEEK " + loRow("Numero").ToString + " ORDER TAG Numero"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SCATTER MEMVAR MEMO"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""USE (" + lcFile + ") IN 0"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""SELECT(" + lcAlias + ")"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""APPEND BLANK"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""GATHER MEMVAR MEMO"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""PHD('IXADD')"")")
>            loDataProviderStructure.CommandTextAdd("EXECSCRIPT(""USE IN (" + lcAlias + ")"")")
>
>
>There is no error on the SET LIBRARY TO D:\WWW\PHDBASE ADDITIVE line. However, the next line will return an error "File 'phd.prg' does not exist.".
>
>So, it is not clear at this point if the loading of the FLL has worked or not. One thing for sure, the application does not return any error on that one. But, the next line need the library to be loaded. As it is complaining, I am assuming the FLL has not been loaded successfully.
>
>Has anyone has any advice on this and/or how to be able to benefit of the PHD('IXADD') line from VB.NET?

Michel,
It may or may not work with execscript. Use stringbuilder to create the script content as a single script and call it as if it was a stored procedure. ie:
StringBuilder sb = new StringBuilder();
sb.AppendLine("SET SAFETY OFF");
sb.AppendLine("SET EXCLUSIVE OFF");
sb.AppendLine("CLOSE ALL");
sb.AppendLine("USE "+lcLocalDbf+"Thread in 0");
sb.AppendLine("SET SAFETY OFF");
//...
string strScript = sb.ToString();

cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "ExecScript";
cmd.Parameters.Add("myScript",OleDbType.Char).Value = strScript;
cmd.ExecuteNonQuery();
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform