|
Agreed with Dave and the 3rd party approach would probably be the easiest to implement.
You might be able to "strip logic" out of a free program that has this functionality already. Maybe check into Paint.Net (not sure if the prog. is open source), but something like that. Check CodePlex as well.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi,
I have created a table in ms-access using VB.NET like below.
ADOXtable.Name = "ACN_CHARX_INSTANCE"
ADOXtable.Columns.Append("LOGICAL_DB_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("DIM_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("CHARX_NAME", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_TABLE", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_VALUE_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("VALUES_UNIQUE", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_ORDER_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_ORDER", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_NUMERIC_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("BITMAP_COL", ADOX.DataTypeEnum.adVarWChar, 128)
cat.Tables.Append(ADOXtable)
After that i gave a primary key like below,
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "LOGICAL_DB_NAME")
But now i want to add composite key for this table..I added the code like the below..
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "LOGICAL_DB_NAME", "DIM_NAME", "CHARX_NAME")
But after executing this code, the key is allocated for Logical_Db_name field only.
Please share your ideas about how to create composite key using VB.NET...
Thanks,
Sivakumar.M.
|
|
|
|
|
sivakumar.mariappan wrote: ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "LOGICAL_DB_NAME", "DIM_NAME", "CHARX_NAME")
Instead of putting all the column names in one line, I think you have to call Append again with the 2nd column, and again for the 3rd that you want to add as part of the key.
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "LOGICAL_DB_NAME")
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "DIM_NAME")
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "CHARX_NAME")
|
|
|
|
|
Thanks for your reply...if i give like below as u advised,
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "LOGICAL_DB_NAME")
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "DIM_NAME")
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "CHARX_NAME")
ADOXtable.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "CHARX_TABLE")
Exception raised...
{"Exception from HRESULT: 0x80040E99"}
Data: {System.Collections.ListDictionaryInternal}
ErrorCode: -2147217767
HelpLink: Nothing
InnerException: Nothing
Message: "Exception from HRESULT: 0x80040E99"
Source: "Interop.ADOX"
StackTrace: " at ADOX.Keys.Append(Object Item, KeyTypeEnum Type, Object Column, String RelatedTable, String RelatedColumn)
at IWSSample.IWSSample.CreateAccessDatabaseandtables(String DatabaseFullPath) in C:\LEGO\June19\IWSSample.vb:line 1021"
TargetSite: {System.Reflection.RuntimeMethodInfo}
Thanks,
Sivakumar.M.
|
|
|
|
|
Well, I didn't say I tested it. I said I think you may have to do something like that. Try reading the documentation on ADOX's Key.Append method. You may have to supply other information to the Append method, like foreign table names and columns.
|
|
|
|
|
Something like this?
key1 = New ADOX.key
key1.Name = "PrimaryKey"
key1.Type = ADOX.KeyTypeEnum.adKeyPrimary
key1.Columns.Append "LOGICAL_DB_NAME"
key1.Columns.Append "DIM_NAME"
key1.Columns.Append "CHARX_NAME"
ADOXtable.Keys.Append key1
Note the similarity with yesterdays index question - have a look at the ADOX object library.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Superb.....It is working fine now...Thanks a lot...
|
|
|
|
|
Hi all,
I have an application in Visual Basic 6.0, which spools text to a text file and then prints. After printing file will be deleted. But here, I couldn't know printer status. Is printing over or still printing...I couldn't know. If I know, I wont delete the file. If that is single file, then I can adjust, but continually 10 files will be printed.
All I want to know the status of the Printer...Please help me out.
Ramesh Sambari
Knowledge is like honey.
Collect it, to make life sweet.
|
|
|
|
|
specialdreamsin wrote: Visual Basic 6.0
Why are you using VB6 ? It really sucks. And, it's unsupported. If you want VB6 help, you should put it in the subject line, so you only attract people who have been developing long enough to remember what that was.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian Graus wrote: so you only attract people who have been developing long enough to remember what that was.
No, no. It's "people who are still young enough to remember what that was."
Us old guys can't remember a damn thing from that far back!
|
|
|
|
|
What you saying humm?
I remember humm everything as if humm it was only yesterday humm!
Everyone knows that once the humm. Sorry, nap time.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Christian, (i'm sure i'll get slammed for this but...)
I'm confused by your question of "Why are you using VB6". While I agree that vb6 and dotnet are night in day in comparison, I'm sure you aware that a developer's tools are not always up to them. If his company has many many applications written in vb6, then it's not always possible to do a mass conversion spending time and resources to do so...finding alternatives to ocx's that were being used, ramp up time learning dotnet stuff replacing the vb6 etc. Not to mention the amount of testing that would need to occur testing the new versions of an existing app as well as possible distribution considerations (installing the app and ms framework on possibly thousands of computers).
Now if the above is not the case and the developer went into vb6 willingly then yes he should be questioned on his choices.
My company has a website written with asp and vb6 dlls. Website has thousands of pages on it and would take years to rewrite in asp.net. $$$$ talks and other projects are more important...
Don't hate me Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
nlarson11 wrote: I'm sure you aware that a developer's tools are not always up to them.
Agreed. Yet, unless this is a legacy project, the question may become, why does your work use VB6 ?
nlarson11 wrote: Now if the above is not the case and the developer went into vb6 willingly then yes he should be questioned on his choices.
And that's why I asked why he's using it, rather than flat out saying 'you should never use VB6'. I know sometimes people have to use it, but I'd say the majority of people I ask that to, on these forums, are not in that boat. A lot actually are surprised they can get VB.NET for free, and are happy to hear it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
vb6 does not expose that itself. You will need to use an API call to check the status. just google "how to check printer status in vb6". it will give you the results you ask for.
Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Hi
If you know the Answer, try to help others. This is the Area where we share knowledge. This is not to fight each other. right ?
Thanks for understanding.
Ramesh Sambari
Knowledge is like honey.
Collect it, to make life sweet.
|
|
|
|
|
Hi,
I know this question is posted million of times and i search on the internet for very long time for the solutions but to no avail.
I want to create a table (called "Customers") in a Microsoft Access database and then insert/delete records into the table and update the table. The table shall have 3 columns:
ID
Customer Name
Customer Address
I know i need to make the "ID" column as an autonumber and a primary key, as i need to insert and delete records and update the table.
I am using the Visual basic 2008 Express edition and quite familar with the OledBcommand. I greatly appreciate if there is any kind, helpful and generous expert out there who can advise me the VB code for this using "Oledbcommand".
Thank you very much.
|
|
|
|
|
If you issue the following command to the Access database, using the oledbCommand and ExecuteNonQuery
CREATE TABLE Customers ([Id] COUNTER, [Customer Name] TEXT(60), [Customer Address] TEXT(255))
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi Steve,
I need the [Id] to be primary key, as i need to insert new records and delete records into the Access database table and finally update the Access database table.
The code:
" CREATE TABLE Customers ([Id] COUNTER, [Customer Name] TEXT(60), [Customer Address] TEXT(255)) "
seems does not make [Id] as primary key.
Pls kindly advise me. Thanks.
|
|
|
|
|
|
Hi All,
I built a program for Creating Entry for running my application to startup. But windows defunder shows it spyware.
Description:
This program has potentially unwanted behavior.
Advice:
Permit this detected item only if you trust the program or the software publisher.
Resources:
regkey:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run\\ABCD
runkey:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run\\ABCD
file:
D:\Program Files\ABCD\ABCD.exe
Category:
Not Yet Classified
So please give me the solution for resolving this problem.
If you can think then I Can.
|
|
|
|
|
ignore defender, or abandon this functionality. IF you want to make your app run on startup, put it in the startup group of the start menu.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
The was tagged as "Potentially unwanted" because applications normally do not modify the Run key. Really, the only time that key should be modified would be at installation time of your app, not run-time.
|
|
|
|
|
you know what i knew that you would post a post like this
sooner or later since you posted a post about sendkeys
are you trying to develop something malicious?
TheMrProgrammer
|
|
|
|
|
And why are you asking me this? Reply to the OP on his post, not mine.
|
|
|
|
|
i ahve a windows(desktop) application softwere which i am working on,
I need to add functionalty in that, like when you minimise you can store tool bar on the taskbar.(like windows media player)
it can be done with VC++ ,VB.NET
any suggetions?
|
|
|
|
|