|
If the code works if you replace MyUserControl with a TextBox, then there's something with your UserControl. Did you design it as a Singleton??
|
|
|
|
|
No, it was not designed as Singleton because I want to have multiple, seperate instances of the user control.
Below is the code for the User Control that I am using to try and figure out what this issue is (Obviously, my "real" user control will have a lot of functionality).
Public Class UserControl1
Private Sub UserControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
|
|
|
|
|
dear friends,
i am new to vb6 programming,i want to upload excell file data to access table,my excel file table Header is like this:
[ExchOrder Ref. No] [Symbol] [Series] [B/S] [Exec.Qty] [Investor ID] [App TimeStamp] [Exch] [Trade Price] [Trade Value] [Sett.No] [Order Ref. No] [ExchTrade Ref. No] [Exch TimeStamp] [SenderID] [Trade Ref. No] [Segment]
here the Squre bracket is given by me.i know the connection statement for the excell file whre header has no space and special character.
and access table field names are same without space and dot.
kindly help
thk in advance
|
|
|
|
|
I'd drop VB6 and move on to VB.NET - you can download one of the free Express IDE's at the Microsoft website[^]. You'll find quite some examples on reading from Excel and writing to Access on this site.
A word of warning for the 'special characters' though; in Excel they are but a label for the column, and you can give the column any name you want. Access is somewhat more restrictive there. Some SQL-tools won't work decently if the tablenames have 'strange' characters.
I are troll
|
|
|
|
|
Hi,
I am having a very simple problem perhaps. I am using visual studio 2008 and have input an access data file called db1.mdb from hard disk. This contains a file called Sheet1. I would like to connect to that database from my form. I am using following code which says connection failure. My file contain no password and username.
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=db1.mdb")
Please help me
|
|
|
|
|
is the .mdb file in the same folder your .exe is in??
|
|
|
|
|
|
OK, then try
- adding a semi-colon
- adding a default account and empty password
- adding an empty account and password
- using full path
This works for me: connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+file+";User Id=admin;Password=;"; where file is a string containing the full path.
This article is an introduction to using MDB files: Using ADO.NET for beginners[^]
|
|
|
|
|
Hi,
Try "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mdb"
good luck
NajiCo
|
|
|
|
|
That works for ClickOnce deployed applications. If you're not using ClickOnce, it's pretty much useless.
|
|
|
|
|
Hi Dave,
Actualy, using "|DataDirectory|" is very helpful to locate a database in the app's folder, it's not restricted to ClickOnce, just give it a try!
best regards,
NajiCo
|
|
|
|
|
Naji El Kotob wrote: is very helpful to locate a database in the app's folder
That's the one place I never put a database. In most corporate environments I've been in, Program Files is ReadOnly, unless absolutely necessary.
|
|
|
|
|
|
Hi,
Great ... on the other hand, check Dave's comment regarding the location of database!
best regards,
|
|
|
|
|
Dear All,
I have simple project,has many forms.I just need to close all other forms if they active(Ex:Need to close Sales Form automatically When Clicking Invoice Form).I am not using MDI Forms.I just need an idea about Code How to implement this.
|
|
|
|
|
In visual studio 2008 if you use the "application framework" you can choose the "shutdown mode" in the project properties. (maybe in older versions of visual studio too, i did not check it)
Project -> Properties -> Application -> Shutdown mode
If you want to write a statement that closes your application you can use
System.Windows.Forms.Application.Exit()
I think the "End" keyword still works too in a VB.Net application
It feels good to learn and achieve
|
|
|
|
|
thanks for reply.you code for Exit the application.But i need a form close automatically while we clicking for another form.
Example
I am working with Sales form and Also clicked for Invoice form.So we have two forms already opened state.I just need Sales form Close itself when i click for another form.in Clearly I need only two forms(Parent form and one child form)active at time.
hope your reply
|
|
|
|
|
There is no built-in support for this. You can make your own based on Application.OpenForms; enumerate all open forms and close the ones you don't want (e.g. main form, and this form)
|
|
|
|
|
|
How do I extract the AxInterop and the AxWMPlib files from wmp.dll??? I did it once but totally forgot how I did it. Need Help on this one.
rspercy
1 + 1 = 186,440....Depending on the species.
|
|
|
|
|
The AxInterop and AxWMPlib files are not extracted from wmp.dll; they are generated by Visual Studio. To re-generate them, you just add a reference to the Windows Media Player COM component
|
|
|
|
|
The Windows Media Player com component does not show up. I have tried the wmp.dll and this fails to register. I registered it with regsvr32 and it still does not show up. I am using VS 2008 pro.
rspercy
1 + 1 = 186,440....Depending on the species.
|
|
|
|
|
Then something has gone wrong. I've just added a reference to the COM component Windows Media Player, and the Interop components are showing up perfectly for me
|
|
|
|
|
The only thing that shows up for me is WMPlib, nothing else.
rspercy
1 + 1 = 186,440....Depending on the species.
|
|
|
|
|
In visual studio 2008 when I add field to the ACCESS database table its not making changes to DGV. However if I delete a field in database its deleting the contents but still showing the field in DGV. I am really puzzled.
Any prompt response would be appreciated.
|
|
|
|