Wpf - Microsoft Script Control - Blocking Scripts' Access To The System?

Nov 4, 2011

I am developing a commercial VB.net WPF application that needs user generated scripts for controlling the application to be shared between users. The best way that I have come across of accomplishing this so far without writing my own parser is using the Microsoft Script Control.

It would appear that both VBScripts and JScripts run through this control have access to wscript and as a result are too powerful to be shared between programmers and non-technical users for obvious security reasons. I have considered trying to filter out dangerous scripts with some kind of regex parsing or something but that just seems far too risky and easy to circumvent.

So, is there some way of using this control but blocking its access to the system so that it could be used for controlling only the objects that I give it? If not, could someone recommend a better way of doing this?

I do not particularly mind what language the script would be in at this stage, although having multiple options would be nice.EDIT: I am basing my conclusion that the control is too powerful for this on the fact that the following JScript code successfully launches notepad when called using the .AddCode and .Run methods of the control.

[Code]...

View 2 Replies


ADVERTISEMENT

Value Of Type 'Microsoft.VisualBasic.PowerPacks.RectangleShape' Cannot Be Converted 'System.Windows.Forms.Control'

Feb 1, 2012

I seemed to have have ruined my settings on VS 2010... I can't get the Shapes to work just after I had fixed the problem with the PowerPacks, and then it deleted all of my shapes I had on my form after I was tweaking the code and added another shape. And ever since, the shapes make errors and I can't change there colors. I've tried reinstalling VS 2010, and changing refferences doesn't work anymore. The title is the problem I have with trying to add a shape through the code in my project, here is the code for that:

Public Class Form1
Public Circle As New Microsoft.VisualBasic.PowerPacks.OvalShape()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[code]....

View 18 Replies

COM Control Call From .Net Frequently Blocking For 15ms?

Nov 19, 2009

I have an ActiveX/COM control written in C++/MFC which processes video (ie. 30 frames per second => about 33ms per frame processing budget) Various rendering aspects of the control can be modified using Set calls on the control, which clients can issue at any time.It turns out that someone (Windows scheduler, .Net interop wrappers, MFC call dispatcher, memory allocator, garbage disposal ?) is quite frequently eating an incredibly long 15.625ms to make or return from the call into the control. Thats half my per-frame budget eaten by some gremlins in the runtime !

The control itself is - for historical reasons - written in C++/MFC. The problem happens when the control is called from C# as well as VB.Net. It happens on very different hardware (an HP Pavilion 2.8Ghz Pentium D, a Macbook Pro with 2.5 Ghz Intel Core 2 Duo running Parallels VM). Just how often this mystery hiccup of 15.625ms occurs differs between machines, but when it does, it is always 15.625ms exactly. Strange.

I have made a rather minimal test case that strips out all the video processing etc.First, I created an MFC/COM Control project in the Project Wizard of Visual Studio 2003 and left things at their default settings (Apartment threading etc.). Then I added a single user defined call TestCall() to the control which does nothing (manually since there is no more classwizard)

Then I created a VB Client program which instantiates the control. It endlessly calls the TestTiming() sub which times how long a single call into the control takes and prints out that time.The TestTiming call basically just does this:

Code: startTime = DateTime.Now Dim h = AxTestControl1.TestCall() endTime = DateTime.Now Dim ms As integer = endTime.Subtract(startTime).TotalMilliseconds

I print out calls that take 0 ms (well something less than 1ms anyway) as "." and for calls > 0ms I print out the actual ms. The output looks something like this:.15.625 ms.........15.625 ms.........15.625 ms.........15.625 ms..........15.625 ms..........15.625 ms...........15.625 ms..........15.625 ms..........15.625 ms

So some variable nr of calls that execute quickly, as desired, and then a "hiccup" call that always takes the exact same amount of time (15.625ms), then some more quick calls.If instead of the user defined control function .TestCall() inside the timing I use a standard control property, like

Code:Dim h = AxTestControl1.Heightor a built in control method like
Code:Dim h = AxTestControl1.ToString()Then I never, ever get a hiccup call.

On different machines you will get a different average number of "." before a hiccup but even then the hiccup is 15.625ms I should mention that the sample code spins off a background thread and calls the TimingTest from its ThreadTask(). This is the way the bug was originally reported to me. However, I can put the

Code:Do TimingTest()Loop

right in the main UI thread - as the first thing in Form1_Load() for example. And it will exhibit the same behaviour, except there will be substantially more good=0ms="." calls on average between the inevitable hiccups.

[code]....

View 1 Replies

Excel Interop: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel Cannot Access The File

Feb 25, 2010

I need to create an excel file from the database records. I fetched and put the data in an excel file and tried to save that file as follows.

[Code]...

View 1 Replies

ERROR[HY000][Microsoft][ODBC Microsoft Access Driver]Could Not Find File '(unknown)'.

Oct 8, 2011

I'm currently doing a project that includes access 2010 My question will be what driver can I use for an access 2010 *.accdb type file? For a *.mdb it works perfectly well with

ConnString ="Driver={Microsoft Access Driver (*.mdb)};Dbq=" & Application.StartupPath & "\CITSDB.mdb;Uid=Admin;Pwd=123;"

But, when I changed the mbd to accdb:

ConnString ="Driver={Microsoft Access Driver (*.accdb)};Dbq=" & Application.StartupPath & "\CITSDB.accdb;Uid=Admin;Pwd=123;"

It resulted in errors:

ERROR[HY000][Microsoft][ODBC Microsoft Access Driver]Could not find file '(unknown)'.
ERROR[IM006][Microsoft][ODBC Driver Manager]SQLSetConnetAttr failed
ERROR[HY000][Microsoft][ODBC Microsoft Access Driver]Could not find file '(unknown)'

And then it shows me that my code for

If dsLogin.Tables(0).Rows.Count = 1 Then
IndexOutOfRangeException was unhandled
Cannot find table 0

I knew it must be the driver but I don't know what accdb driver I can use for the connstring.

View 3 Replies

.net - ERROR [22018] [Microsoft][ODBC Microsoft Access Driver] Data Type Mismatch In Criteria Expression

Dec 7, 2011

I have an error ERROR [22018] [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. and I've been trying to solve this but unfortunately I couldn't get the hack of this error. I'm a newbie in dotNet.

Public Sub LogInContinue(ByVal senter As Object, ByVal e As EventArgs)
Dim LibDS As DataSet = New DataSet
Dim LibDA As OdbcDataAdapter = New OdbcDataAdapter("SELECT * FROM tblUserAccount WHERE Uname='" & txtUserName.Text & "'", LibConn)

[code]......

View 2 Replies

Facial Recognition Access Control System

Sep 3, 2010

I am doing Facial Recognition access control system as my final year project.I need your support to find a fully free Face recognition, or Face Matching SDK for VB 6.

View 1 Replies

Connect To Microsoft Access Database Using "Microsoft DAO 3.6 Object Library"?

May 3, 2012

I have vb .net windows form application that I want to connect to Microsoft access database using "Microsoft DAO 3.6 object library". My problem is that when I go to Project tab -> Add reference -> COM tab, there should have been "Microsoft DAO 3.6 Object Library" on the list, but for some reason It's not on the list. Then I googled, and found out that the location of "DAO360.DLL" is "Program FilesCommon FilesMicrosoft SharedDAO". After clicking on Browse tab, I browsed to that location, and I guess I added reference on another way.This is the code that I used before for connecting to Access, but for some reason It doesn't work this way on this PC.

[Code]...

View 9 Replies

Program To Access A Microsoft Access 2010 Database?

Sep 9, 2010

I coded a program to access a Microsoft Access 2010 database. The program is written using Microsoft Visual Studio 2010. I get the error message that the database I'm trying to access is in an invalid format. look at the code below to see what I missed. The error is in the datasource statement.

[Code]...

View 6 Replies

Microsoft.VB.Now Vs System.DateTime.Now

Oct 8, 2010

Is there any difference between using the Microsoft.VisualBasic.DateAndTime.Now compared to the System.DateTime.Now? I seem to remember reading something that said the MS.VB namespace was for legacy use only, and was much slower than using the native .net classes.

View 5 Replies

Chance Exception Of Type 'System.ArgumentException' Occurred In Microsoft.Vis?

Feb 23, 2012

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim tab As New Form
tab.Size = New Point(500, 500)
tab.Location = New Point(500, 500)
tab.Text = "Loading"

[Code]...

View 4 Replies

An Unhandled Exception Of Type 'System.InvalidCastException' Occurred In Microsoft.VisualBasic.dll

Feb 26, 2012

I'm a beginner to Visual Basic. In here I want to recreate a piggy bank which tells me how much money do I have. I created a function but the program tells me :

[Code]...

View 2 Replies

Run-time Error In Other PC: Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(System.String[])

Mar 15, 2012

VB.net application crashes without specific error

I developed one application in VB.Net 2010. It worked fine on my laptop. Now when I run this on another PC, it just crashes and give windows error as below.

[CODE]..........................

Along with this.

[CODE]......................

This application required .Net framework 4 & Oracle 9 ODBC drivers, which I installed on new PC.

I am not able to figure out what is the problem exactly, however it seems something with .Net framework itself.

View 2 Replies

Unzip A Zipped Folder Using Microsoft APIs Or Namespaces Perhaps System.IO.Compression?

Sep 19, 2009

can we unzip a zipped folder using microsoft APIs or namespaces perhaps System.IO.Compression. However, it seems to be cumbersome to use them. With a thrid party dll file it works perfectly fine, however i dont want to use it as we dont know what is actually happening inside. Can we have a piece of code which unzips a zipped folder.

View 3 Replies

Using If Then Statement In Microsoft Access

Nov 1, 2010

I'm trying to use the if then statement in Microsoft Access What I want is when someone clicks on a button and if the password was correct then go to the form Contact detail but if the password was incorrect then exit Microsoft Access. I have the command that exits Microsoft Access.

View 2 Replies

VB And Microsoft Access Integration?

Feb 21, 2011

I am a student at the University of Findlay in Ohio. In our software engineering class we were given an assignment to make a database of 2 tables in Access. Simple enough. We then had to integrate that database in to VS. Again, quite simple. Along with that we are to make 4 reports that can be displayed to the user.

The problem comes here. I can not figure out how to allow the user to select say a Recruiter Number and show all the Clients who that recruiter is in charge of as well as the amount of money they owe and what they have paid already. Also I need to total those two values.

[Code]...

View 1 Replies

Error : A First Chance Exception Of Type 'System.InvalidCastException' Occurred In Microsoft.VisualBasic.dll

Oct 9, 2011

Error is Simple Application -- Error Type (A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll)

View 3 Replies

System.invalidoperationexception The Microsoft.jet.oledb.4.0 Provider Is Not Registered Windows 2008 64 Bit Server?

Nov 15, 2011

I am trying to run a vb application on windows server 2008 64 bit. it has an access database and give the error "system.invalidoperationexception the microsoft.jet.oledb.4.0 provider is not registered "

View 2 Replies

.net - Migrating Application From Microsoft Access To VB Or C#.NET?

Sep 5, 2010

I'm currently trying to convince management of the need to port one of our applications to .NET. The application has grown to be a bit of a monster in Access (backend in SQL), with 700 linked tables, 650 forms/subforms, 130 modules and 850 queries.

I pretty much know all the major benefits of doing this, but now need to look at how this can be achieved technically, so I can put a project plan together.So, my plan was to convert the queries into stored procedures and/or views on the backend and re-write the forms in WPF or WinForms.

Now, the code is where I come unstuck. Is it possible to packaged up the code behind and modules into dlls and consume them whilst it is slowly ported to VB/C#?

What we can't be left with is half an application in VB/C# and half in Access, it must 'appear' to all be one application, even half way through the migration.EDIT: Just some more info about what we do and why we're looking at moving away from Access.We are essentially an ISV and the Access application is our main product. This application has been developed over a period of 15 years, by many, many developers on an ad hoc basis. There is no documentation for this application.

We also have problems with getting branching in SCC to work properly, so we've currently got 4 or 5 code bases for the half a dozen clients we have. On top of that, all the testing we do is completely manual, which you can imagine is very labour intensive, and only scratches the surface of what really needs to be tested.We're currently looking to expand, and have a number of sales leads that are in the final stages. I'm worried that with these new sales, we're going to be swamped with support and testing, and that this application is going to become even more entangled an buggy.

I'll also add to this the fact that we're just about to enter the spec phase of a brand new product, which is almost certainly going to be built in .NET. If we were to rewrite the Access application in .NET, then the people we use for that can go straight on to this new development. If we were to stay in Access, then we'd have to get some new Access people in, whom would have to be retrained once we start the new development.

So essentially it has come down to two choices, major refactoring work in Access to try and 'organise' the code a bit better, and those of you who have suggested culling parts are most probably right; I'm sure there are parts that are no longer used. However, I fear that if we stay in Access we still won't be able to build in effective testing and we still won't have proper SCC branching, which will lead to support continuing to be a nightmare, and any future developments on this product makings things worse. Either way there is a lot of work that we're about to embark on, which is either going to be done in Acces, or .NET.

View 5 Replies

Add Lesson To Chapters Through Microsoft Access?

Feb 20, 2012

add Lesson to Chapters through microsoft Access

View 2 Replies

Best Way Of Accessing Microsoft Access Databases

Jan 24, 2012

I use Microsoft Access databases for my big project but I find the performance is very hit and miss. I time the processes and sometimes there is some serious lag. Here is an example of the code I use:[code]I was told that this is a very old method of accessing databases, which doesn't surprise me since it's the same basic code I was using back in VB6 about 8 years ago.

View 39 Replies

C# - Microsoft Access 2007 Connection?

Jul 4, 2009

I wrote a program that connected to a Microsoft Access 2000/2003 mdb file and accesses the data. It works fine, but I'm wondering if there is a way to connect to Access 2007? If I change my connection string, will my program work with access 2007 or is it more complicated then that? And if it will work, can someone provide an example of an Access 2007 database?

View 2 Replies

Create The Same Storedprocedure In Microsoft Access?

Feb 15, 2012

I have a storedProcedure in SQL-Server that I am using to delete duplicates from one of the tables. This storedprocedure makes use of a cursor.I tried to create the same storedprocedure in microsoft access by just replacing the 'CREATE PROCEDURE' with 'CREATE PROC' but it didn't seem to work.

Here is the SQL- storedprocedure:- ALTER PROCEDURE [dbo].[csp_loginfo_duplicates] AS BEGIN

SET NOCOUNT ON;
declare @minrowid bigint
declare @empid nvarchar(15)
declare @dtpunched datetime
declare @count tinyint

[Code]...

View 1 Replies

Database Microsoft Access With VB 2008?

Jan 2, 2012

I made a Microsoft Access Database on my old computer and it worked fine with vb 2008When i try to go to my form containing the tables from Microsoft access, I get this message

View 3 Replies

Open A Sdf File In Microsoft Access?

Aug 25, 2009

Is it possible to open a .sdf file in Microsoft Access?

View 2 Replies

Pass Data From VB To Microsoft Access?

Mar 14, 2009

Remove a record from a Access database using a VB?I have created a small database in Access,then using VB 2008 Express Edition, created a link between Vb form and Access When I try and Add then Save a record, the information is not in the database.But I can't remember how to:-*Add a record*Save the record*Edit an existing record*Find a record in the databas of interest, is it possible for the add button to be clicked when the VB form loads, and if so how do I achieve this

View 2 Replies

Updating Microsoft Access Database?

Jan 13, 2011

I'm developing a program utilizing an Access database and Visual basic. I'm having a problem saving the data I'm adding to the database. I'm entering the data into the database table with text boxes and making a new row and adding it the the table:Database2DataSet.Tables("").Rows.Add(newRow)

I have a grid view for the table, and the new row is added to the table, showing that I'm getting the new information into the table. However, I'm trying to save this new information to the database so its there after I close the program. I've tried using the following but none have worked so far.

[Code]...

View 1 Replies

VB Project Using Microsoft Access Database?

Jul 15, 2008

I am taking Computing at A Level and need to create a solution for a business.I have thought of my solution which is a log of all the cars that go out on test drive for my dads motor company, i have created a database in Microsoft Access and have saved it as the usual mdb file. i have then imported this into the project and would like to use it.I have created a login form which i would like to use along side the database in the sense i would like it to check when a user enters their name and password for those two things in the database and respond accordingly. I also have created forms in which employees would enter information and then click the submit button, i need this to then place the information into a database as records under the right headings.I have tried using the program and play about a bit but i just can't understand it easily, even when i search for help i have trouble understanding what it all means.If someone could help me that would be great cheersLongy1259

View 4 Replies

Use Microsoft Script Control In .net?

Feb 3, 2012

I would like to execute vbscript code in vb.net using the microsoft script control (msscript.ocx).theirs an executestatement or addcode method i can use which one should i? I've been trying to convert my vbscript to vb.net but its too complex even though its not big and thought this control might help me save time. Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt.

View 4 Replies

Use The Microsoft Amination Control?

Feb 28, 2009

Does anyone know how to use the animation control. Because I think its what i have been looking for to put images into a sequence and then export them as one file code - I have none Thats why i posted

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved