Jump to content
Xtreme .Net Talk

SimDuck

Members
  • Posts

    21
  • Joined

  • Last visited

SimDuck's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thank you PlausiblyDamp. The link was a big help. What I didn't do was set up FormC to receive both Form A&B in the sub new. I only had FormB in there. I realised I needed to pass reference to both FormA & FormB to FormC's sub new from FormB. Thank you again
  2. Hi, I�m having a problem accessing a sub routine between forms I have three forms FormA FormB FormC FormA calls FormB modally (with backwards data links) and FormB calls FormC modally (with backwards data links) My problem is that I have a sub routine in FormC that needs to access a public sub routine in FormA and then have some data returned. I have tried: (FormC�s sub routine) Dim frmFormA as FormA (FormA has no sub new declarations) frmFormA.subroutine(declarations) When I call FormA�s subroutine, FormC exits and shows FormB modally. I don�t want to declare a new FormA in FormC as I need to have access to the data stored in FormA. How do I declare FormA i(with current data) n FormC, access a sub routine in FormA and then return the data to FormC�s sub routine? Thank you
  3. Thank you. This works well. I have copied the code & created the new exe. It deletes the file beautifully. I modified the DeleteExe.exe code to delete the whole directory (DeleteExe.exe is in this directory). When it gets to the delete command, it deletes every file except for the DeleteExe.exe file throwing the exception "Access is denied". I'm thinking that I'll move the file first & then use my application to delete it upon its loading. Thank you heaps for your assistance. I appreciat it :)
  4. DriverDan, this sounds like an excellent idea. I have tried to do this but I don't know how to call a dll with out it being referenced to the calling form. :confused: This is my exit sub routine: Private sub btnFinish_Click(ByVal sender as System.objecti, ByVal e as System.EventArgs) Handles btnFinish.Click startform() Me.Dispose() End Sub Private Sub startform() Dim frmPatchClean as new Patcherdll.frmPatchDllMain(me) frmPatchClean.show End Sub I have the delete folder code in the dll with the timer How do I call a dll without having a reference to it ? Thank you
  5. Thank you Cags & DiverDan. Cags, you are correct. I have created an *.exe with vb.net. I am extracting the exe to a temp folder (along with some other files) & then running the exe. The exe's job is to copy the files to a specified directory & then delete the whole folder including the exe. Unfortunately, I can't work out how to delete an open file or load the exe purely into memory so I can delete it later. I want the copying/ patching procedure to be clean I have tried the threading but I'm not very experiend with vb.net programming. I'm trying to self learn & I'm trying different ways to achieve what I want. I have had an idea that there might be a way that I can set a windows setting that will delete the file upon next load. Is this possible & if so, how do I do it? I'm open to suggestions to solve my problem. Thank you
  6. @ PlausiblyDamp Hi, I'm wondering if you can help me with a problem I have? I'm trying to open an executable file which copies some files & deletes the whole directory including the file that is originally opened. I'm getting an error saying that the file is in use. My question is, is there a way that I can run a file, script or code & put it in to memory & run it from memory so I can delete the files once I'm finished with them? Your assistance is appreciated. Thank you
  7. @TheWizardofInt, by any chance, have you resolved this as I am having the same problem. I am trying to do the same as you and after a certain amount of dll acces times, the dll code doesn't seem to work. Thanks
  8. APaule, I did this and the password change worked. I have ancountered another problem though and am wondering if you could help me. If I run the sql query : "ALTER DATABASE PASSWORD new password old password" with a connection string of: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"strDataSource "';Mode=Share Deny Read|Share Deny Write" and when I try to change the password to a new one, I get an error saying that the password isn't valid. Do I need to change the sql query when the database has a password already? Thank you
  9. Hi, I did step through my code. The path & database are correct. When I leave the ";Exclusive=1" off of the connection string, then: DBCon.Open() works fine. But when ";Exclusive=1" is part of the connection string, then the error is generated on DBCon.Open() I am thinking that ";Exclusive=1" is causing an error and not opening the *.mdb in "non share mode". Do you have any other suggestions? Thank you so far. I have appreciated it.
  10. Hi again Chester. I have done what you suggested with: Dim strDataSource As String = TextBox1.Text strDataSource = strDataSource & "\" strDataSource = strDataSource & TextBox6.Text strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source='" & strDataSource & "';Exclusive=1" I still get the same exception error. Thank you for your advice.
  11. Hi Chester, I added it to my connection string to make: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = Y:\Work Computer Data\Work Data\Visual Basic Projects\Projects\Accounts Package\Version 1\Data\test.mdb;Exclusive=1" and received this error when trying to open the database : "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll" With out the ;Exclusive=1, the database opens and I get the shared open database error. This is my code that I am trying to change the password strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source = " & TextBox1.Text & "\" & TextBox6.Text & ";Exclusive=1" Dim DBCon As New OleDbConnection(strConn) DBCon.Open() SQL = "ALTER DATABASE PASSWORD " & TextBox4.Text & TextBox5.Text Dim strCommand As String = SQL Dim DBCommand As New OleDbCommand(strCommand, DBCon) 'execute the query Try DBCommand.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message) Finally End Try DBCon.Close() DBCommand.Dispose() Any assistance is welcome and appreciated. Thank you again Howard
  12. I am using the sql query "ALTER DATABASE PASSWORD new password old password" and I get the error "cannot change password on a shared open database". As this database isn't open any where else, what would be sharing it? Is this the correct sql query to change the password or is there a better one? I am using the oledb DBCommand.ExecuteNonQuery() command to update the database. Your help is appreciated. Thank you
  13. Hi, I am trying to change a password on my Access database programmatically. I have tried the sql query: "ALTER DATABASE tabletochange ADD/ALTER PASSWORD password" to no avail. I am wondering if any one can tell me what the sql query is that I need to run to chang the password on my database is? Thank you for your assistance
  14. I can see the constraint when I create a dataset & view the xml schema in design mode. It has a key next to afield. I ran this command "SELECT CONSTRAINT_NAME FROM Account_Details.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME = 'Account_Codes'" and got this error "The Microsoft Jet database engine cannot find the input table or query 'TABLE_CONSTRAINTS'. Make sure it exists and that its name is spelled correctly." I'm sorry, I failed to mention that I am using MS Jet database engine to access my Access 2000 database. I changed "INFORMATION_SCHEMA" to the database name because an error said it couldn't find table INFORMATION_SCHEMA Is there another thing I could try? Thank you for your assistance
  15. Hi, I have a table where I wan't to remove the Primary key. I run the sql command of "ALTER TABLE table_name DROP CONSTRAINT Primary_key" The error I get is "CHECK constraint 'Primary_Key' does not exist. When I added the Primary key, I used the sql command of "ALTER TABLE table_name ALTER COLUMN column_name varchar(30) PRIMARY KEY" This added fine because I now cannot drop the column. I am trying to find the constraint name so I can delete it. I have run code to try to find the constraint name. This is what I have run: Dim cs As Constraint For Each cs In dsBudget.Tables.Item(0).Constraints Console.WriteLine(cs.ConstraintName) Next cs The problem I am facing is that this code cannot pickup any constraints. If I use code to find a primary key, the array returns -1 indicating that there is no primary key. The table or column definitely has a primary key. My question is, if I can't find out the name of the constraint, how can I remove it? Thank you for your assistance
×
×
  • Create New...