|
I went and changed the security settings on the folder and tried again, but it didn't work. I got this error message (after removing my Try..Catch statements)
"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.windows.forms.dll
Additional information: No error information available: DB_SEC_E_AUTH_FAILED(0x80040E4D)."
|
|
|
|
|
Did you password protect your Access database or enable workgroup security in it?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I did a while ago, but I wasn't able to get connection strings to work with it so I removed them.
|
|
|
|
|
fatali8 wrote: so I removed them.
Something got missed because that's where the security failure is comming from.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
No, I got them all. I figured out what happened. For some reason my connection to the server got messed up somehow.. I could Remote Desktop to it, but I couldn't map any shared drives/folders and I couldn't access any of my previously mapped drives. I've had it happen before, and I'm pretty sure it has something to do with the fact that when I turn off my PC I Hibernate it, mainly because I have work open and don't want to wait for them to all open up again. As well as that, I missed a part in my connection string that had username and password information from when I was trying to connect to a DB with a DB password. That kind of mistake makes you want to say "idiot" doesn't it? lol.
Anyway, now after a restart I got it to work. Thanks for all the help. I got more help from you than I did in all of the other 4-5 forums I've asked in combined. From now on I'll just come here when I need to ask a question. Again, thanks.
|
|
|
|
|
Hello All!
I have two forms in a project. vb.net. I just want to take the value from 1 textbox on a form, and put it in a string in another from.
My code.
Public Sub frmGoodLuck_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim MainFrm As New Mainfrm<br />
<br />
lblGoodLuck.Text = ("$" & MainFrm.txtTblID.Text.ToString & " has been added. & Good Luck!!")<br />
<br />
End Sub<br />
End Class
What am I doing wrong?
Thanks! Rudy
|
|
|
|
|
2 quick questions. Did you get an error message? And does the label txtTblID exist on MainFrm ?
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Hi Matrix!
No error. and lblTblID does exsisit on Mainfrm.
Thanks!
Rudy
|
|
|
|
|
Well, I'm not sure what the problem is. But here are a few steps that might fix it:
1. Make sure that there's pre or otherwise set text in txtTblID .
2. Try saving your text to a variable, then reading the variable from your label.
And, what exactly happens when you try to set text to your label? Is the label just blank?
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
It's blank, because he's getting his value from a newly created instance of the form.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You are creating a new instance of the Mainfrm class. That instance will work independently from the one that already exists.
You have to use a reference to the form that already exists in order to access it's controls.
---
Year happy = new Year(2007);
|
|
|
|
|
Hi Guffa!
Could you give me a quick example.
1) myMainfrm.Show()
myMainfrm.GetTblID(Me) NAME OF FORM <"loggonfrm">
2)Public Sub GetTblID(ByVal TblID As Loginfrm)
txtTblID.Text = TblID.txtTableid.Text
End Sub NAME OF FORM<"Mainfrm">
Something like this?
Thanks!
Rudy
|
|
|
|
|
No - do NOT do this. Do NOT make your form elements public.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Well, your whole approach is wrong, your controls should not be made public. Instead, expose a property called TblId, or whatever.
rudemusik wrote: Dim MainFrm As New Mainfrm
This is your problem. You're creating a new MainFrm instance, which as no text on it. It's a different instance to the one that contains the text you want. You could get around this with a static property, or you can set up delegates to pass the info. It looks to me in this instance that you should either pass the value of the text to a constructor, or set a property that sets the GoodLuck label on this form, as MainFrm is obviously the class creating this one, and as you're handling the load event, it's obvious you want to set the text when the form opens.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks Chris!
I see where my problem is. So what are some of the reasons I don't want to use Public? I never gave it much thought. What harm could it do?
Thanks!
Rudy 
|
|
|
|
|
It's just bad practise. The whole point of OO is to write objects that hide their inner workings. Expose only what you need to, which in this case, is a string, not a textbox.
IT's not that your program won't work, just that it's better to form good habits.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i'm using VB 2003, i want to make form with a button that open another form and in do some processes, and close the form, but i want my first form to know when it's done so i can do another process.
anyone have any ideas on how to do it ?
|
|
|
|
|
|
How can I make my application attach to multiple com application? I would like to provide a list of com applications installed on the user's pc.
For this reason I can't create a reference to the com object during runtime. It should be dynamic as per user selection. It could be an Excel, Word or other com application.
Summary
1) To get a list of all com applications available on the user's pc
2) To create a reference dynamical to what the user chose.
Thanks
|
|
|
|
|
|
Have you changed the property of the "anchor"?
|
|
|
|
|
Yes I changed it ,
Is any problem on that .?
thanks for reply
jooooo
|
|
|
|
|
What did you think it did ? It moves the control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I think that Anchor propery is keep a constante distanse between a certain aidge of the form , like Top:Left ,,
I think that is useful on resizing the form ,,
it's it ,,,
if that is true then why the location of components is changing but themselfes ,, really
jooooo
|
|
|
|
|
you are correct. the anchor will also resize the control if you have both either off the opposite sides of the anchor set top/bottom or left/right.
if you have the windowstate set to maximize in design time, when you run the app, it could possibly move the controls depending on how you have the anchor set. if you have everything set as top/left (default) then none of the controls should be moved around...
|
|
|
|