
BigSi
Members-
Posts
22 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by BigSi
-
Thanks squirm, that worked great! - I did try using the timer and a for loop, but i only succeeded in making my computer hang!
-
Hi, im trying to work out how I can prevent some code in a sub routine from running for a few seconds. for example if I had 2 message boxes, and wanted the second one to open 5 seconds after I cliked ok on the first. - is this done with the timer? Thanks - Si
-
Set the Read Only attribute of a file
BigSi replied to BigSi's topic in Directory / File IO / Registry
nevermind - I found it :p SetAttr(Filename, FileAttribute.ReadOnly) -
Hi, Does any one know how to enable the read-only attribute of a file such as a text file or an Access file (eg: c:\myFolder\myTextfile.txt) - I want to be able to control its read only state in vb with a simple button. This should be the same as going into the file properties and ticking the Read-Only box. Your help is greatly appreciated!
-
Hurray!! - just found a way to use a string variable! Dim DatbaseLocation as string DatabaseLocation = "C:\my database\databasename" DatabaseLocation = """" & databaseLocation & """" System.Diagnostics.Process.Start("MSAccess.exe", DatabaseLocation) Thanks again Andy for your help!
-
Andy, Thanks for your help andy - the double quote worked perfectly! - the only problem now is that I should have mentioned I was working with variables so the location of the mdb file could be anything! Do you know if there is a way to adapt the double quote to use it alongside a string variable? Otherwise I guesse I'm gonna have to break down all the directories and discover which ones have spaces, so I can convert them to the 8 char naming system. Once again - thanks for your help! (oh - and that apostraphe should not have been there, I accidently put it on whilst posting this message. well spotted though!)
-
Sorry Andy, I think I havn't clearly said what the problem is! the following code works fine as there is no space in the directory name: System.Diagnostics.Process.Start("MSAccess.exe", "'C:\mydatabase\databasename") but this code doesn't as there is a space in the directory name System.Diagnostics.Process.Start("MSAccess.exe", "'C:\my database\databasename") I am trying to find out if there is something I should subsititute for the space character such as my%database/databasename
-
Hi, Im using the Process.Start method to open Access which is working ok until I use the arguments. Currently to open a specific access database, i use: System.Diagnostics.Process.Start("MSAccess.exe", "'C:\mydatabase\databasename") This works fine, but when i have a directory with a space in it such as 'my database' I get an error as access looks for the .mdb file called 'my'! Is there a way to prevent the space causing this error by suplementing the space character with some thing else? cheers, Si
-
Open Access and launch a specific report
BigSi replied to BigSi's topic in Interoperation / Office Integration
Thanks Heiko, that AutoExec macro worked wonders! -
Open Access and launch a specific report
BigSi posted a topic in Interoperation / Office Integration
Hi, I'm wondering if it's possible to create a button that launches an access 2000 database file 'database.mdb' and then opens a report which the file contains called 'report1' - Does anyone know if this is possible to do, or am restricted to opening it as normal? Thanks in advance for any feedback! Si ( - I hope this was the right place to post this question, it was either here or in databases!) -
Hi, Thanx for replying and for the help, it was just I had trouble accessing the forms events (such as its closing event) via this method untill I had realised that they could be found under the Base class events!! - stupid me :( I apolagise for my mix up between properties and events too, I just couldnt think of the correct termonology at the time of writing. Anyway, thanks very much for your help, I'm now getting back on track and getting more familiar with the .NET developing platform. Cheers, Si
-
Hi - Iv'e only just recently migrated from using vb6 to .NET, and remember in VB6 you were able to find out the properties of a class quickly- for some reason I am having trouble doing this in .NET. Is there a way of finding out the different subroutine properies of something like a my "textBox1" on a form such as its loosefocus event? - Im sure there was a quick way to do it in VB6 and I am yet to do so in .NET without looking in the help files for its properties - I think VB6 used to provide a dropdown list of these properties, and I cant seem to access them now in a similar way! I hope you understand what Im trying to say! Thanks, Si
-
Excellent - Thanks for your quick reply :) heres the code that I ended up using if anyone is intrested Private Sub Account_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Dim CloseAnswer As Integer CloseAnswer = MsgBox("Are you sure you want to close this form?", MsgBoxStyle.YesNo) If CloseAnswer = 6 Then 'the user wants to continue quitting 'Me.Close() Else 'the user has changed his/hers mind e.Cancel = True End If End Sub
-
Is there a way to prevent a form from closing when the user clicks on the close button on the top right of the form. I plan to bring up a message box asking if they are sure they want to do this - I cant seem to find how to do it in VB.NET :( Thanks. Si
-
Excellent - thanks very much, adding shared to declaring the variable has worked perfectly! Thanks for your help.
-
Hi, Im trying to work out how I can access the origional startup form (MainMenu) variables. Normally to do this I would call an instance of a form as it had been created as a new form and had been given an id and the variable I want to access would be stored in a public declaired variable. For instance when I want to access data from a form that I have opened from the main form, I would create the new form like this: Dim frmAccount As New Account() frmAccount.Show() In that form I would have declaired a variable (and assigned a value to it) by doing this at the top of the form Public CLADBLocation As String and to access this variable from the origonal startup form I would use this myNewVariable = frmAccount.CLADBLocation The problem is that I do not know how I can refer to a public variable in the default startup form(MainMenu) as I have not assigned it a name to make it show. Can anyone help?
-
check Here as I have found a really usefull resource for what i was trying to do - Thanks for all your help!
-
Excellent - thanks for the refrence, it looks quite helpfull so ill give it a go! just testing the vb code Cheers
-
This is what I have so far .... ----------------------------------- Private Sub lstAccounts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstAccounts.SelectedIndexChanged 'Displays the primary key id of the firm selected in the list box txtCompanyName.Text = lstAccounts.SelectedValue Dim conn As New OleDb.OleDbConnection() Dim MyRs As ADODB.Recordset conn.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\simonlane\My Documents\Visual Studio Projects\CompanyLearningAccount\Database\CompanyLearningAccount.mdb;") conn.Open() MyRs = New ADODB.Recordset() 'query refers to the primary key field, which is found in the list box '****For some reason the line of code below is failing to work! MyRs.Open("SELECT * FROM Firm where FirmId = '& lstAccounts.SelectedValue & '", conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) 'some code to access records field values, and declaire them such as fieldFirmName = recordsetfieldvaluex MyRs.Close() conn.Close() 'txtFirmAddress1.text = ExtractedDBValue End Sub --------------------------------------------------------------------------- I cant seem to open my recordset, and also I am unsure how to then extract the recordsets field values and store them as a variable
-
hi, I have been searching around for working with access in .Net for a while now as I am producing my first .net application since I am used to nworking in vb6. Im hoping to try and get data from certain fields in access to be displayed in a text box. This is probably an easy task, but I have seen posts about this on the forum refering to using the .net method instead of the .com. So far I have successfully filled a listbox with database contents, and now I am wondering how I should be connecting to my access database 'correctly' as I can now refer to my allready established oledb adapter. - should i br refrencing this in a connection string? Anyway, Im hoping someone can provide me with some code, or a shove in the right direction on creating a database connection, and then filling a text box with a value for when a button is pushed, Many thanks Si
-
Hi, Im trying to get used to vb.net after using vb6 and am having trouble accessing an MS ACCESS database - Im trying to display results of a query in a listbox on a windows form. In VB6 I managed to do this by adding 2 things (its been a while!) to a form, one was a list box, and the other was a data controll which I believed the list box refrenced - I cant seem to remember how I done it, especially as I now have .net infront of me which is really confusing to start with - it took me a while to work out how the simple task of opening a new form was to be done. I'd appreciate any help!!! thanks, Si