|
It doesn't look like your changing the X and/or Y position, causing each textbox to be positioned directly under the last textbox that was added.
|
|
|
|
|
I wrote the code these to Update Database Access after do editing in form Vb6. Code is like this
Private Sub CmdUpDate_Click()
Set ws = DBEngine.Workspaces(0)
Set dd = wS.OpenDatabase("C:\Project\Project.mdb")
Dim rs As Recordset
Dim Sql As String
SqL = "select * from report_tab where idd='" & T1.Text & "'"
Set rs = dB.OpenRecordset(SqL, dbOpenSnapshot)
With RsLap
.Clone
!no = T2.Text
!ext = T3.Text
.Update
MsgBox "Updated", vbOKOnly
End With
but, after I click Button Update windows is appear VB error Run-Time
the massage is
'cannot update Data base is read only'
what i must to do?
|
|
|
|
|
labq581 wrote: Private Sub CmdUpDate_Click()
Set ws = DBEngine.Workspaces(0)
Set dd = wS.OpenDatabase("C:\Project\Project.mdb")
Dim rs As Recordset
Dim Sql As String
SqL = "select * from report_tab where idd='" & T1.Text & "'"
Set rs = dB.OpenRecordset(SqL, dbOpenSnapshot)
With RsLap
.Clone
!no = T2.Text
!ext = T3.Text
.Update
MsgBox "Updated", vbOKOnly
End With
What is RsLap, and why do you use .Clone? Normaly you use Clone something like that:
Dim rs as Recordset
...
'open recordset rs
...
Dim rsClone as Recordset
Set rsClone = rs.Clone
Regards: Didi
|
|
|
|
|
also ensure that T2.text and T3.text is above your SQL statement
|
|
|
|
|
Something like this might work.
SqL = "select * from report_tab where idd='" & T1.Text & "'"
Set rs = dB.OpenRecordset(SqL)
With rs
.MoveFirst
.Edit
!no = T2.Text
!ext = T3.Text
.Update
MsgBox "Updated", vbOKOnly
End With
My Access is a bit rusty but IIRC, dbOpeSnapShot gives a read only recordset.
You also need to make a record current by doing a .MoveFirst/.MoveNext and you need to call .Edit.
As I said, I'm a bit rusty but think this is what you need.
If something like this does not work, maybe it's file/folder permissions?
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
I have an idea to make an edit form with datagrid, but i want to create data combo into datagrid by access data base, please give me solutions.
|
|
|
|
|
Check the documentation on how to use a combobox-cell in your datagrid
Regards: Didi
|
|
|
|
|
|
Hello,
I'd like to know if there is an easy way to check whether the cd in my drive is a DVD, CD or Blu-ray disc. This is needed because I need to calculate the disc usage (%). But when I use Drive.TotalSize it returns the amount of used bytes and not the total capacity. I found some code to do this, but the code was enormous, and I need a compact solution.
Cheers,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Win32_CDROMDrive class might be of your interest. It has properties regarding the media size.
जय हिंद
|
|
|
|
|
Hey! Thanks fot your response. I have tried figuring out if a medium is a DVD or CD using Win32_CDROMdrive with the following code:
Dim driveMedia As New ManagementClass("Win32_CDROMDrive")
For Each mo As ManagementObject In driveMedia.GetInstances()
MsgBox((mo.GetPropertyValue("MediaType")))
Next
However, this returns the type of drive e.g DVD Rewriter etc. Now I figured out that I can determine the media type with Win32_PhysicalMedia (Link)[^], but when I use .GetPropertyValue("MediaType") there it returns Nothing (or an empty string, I'm not sure) while it should return the type of media, e.g CD Rom, DVD + etc.
I don't understand why this doesn't work. Please help me out?
Zaegra
Motivation is the key to software development.
|
|
|
|
|
I thought your aim is to find the total size of the media. Not sure how to identify if the media is CD or DVD. I think looking around in the similar kind of classes will help.
जय हिंद
|
|
|
|
|
That's exactly my aim, but to find the total size I need to know the media type. Or do you know another way to accomplish this? Thanks for your reply btw
Motivation is the key to software development.
|
|
|
|
|
What does Win32_CDROMDrive.MaxMediaSize and Win32_CDROMDrive.MaxMediaSize return?
जय हिंद
|
|
|
|
|
That's the thing: It returns Nothing. I'm using the following code:
Dim driveMedia As New ManagementObjectSearcher("Select * From Win32_CDROMdrive")
For Each mo As ManagementObject In driveMedia.Get()
Debug.WriteLine(mo.GetPropertyValue("MaxMediaSize"))
Next
Seems right to me..?
Motivation is the key to software development.
|
|
|
|
|
Code below works fine for me. "Size" will be returned ONLY if there is a DVD in the slot.
ManagementObjectSearcher o = new ManagementObjectSearcher("select * from win32_cdromdrive");
foreach (ManagementObject obj in o.Get()) {
string s = obj.GetText(TextFormat.Mof);
}
Hope this helps.
जय हिंद
|
|
|
|
|
You can do it by using FileSystemObject
Dim _oFSO = CreateObject("Scripting.FileSystemObject")
Dim _oDrive = _oFSO.GetDrive("G:")
MessageBox.Show(_oDrive.TotalSize)
hth
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
No, this returns the used size of the cd and not the total capacity. By total capacity I mean for a CD ~ 700 MB, and for a DVD ~4.7 GB etc. I have to know this because I have to calculate for how many percent a cd is used. (Used space / Total Capacity) * 100. Any other ideas, maybe?
Thanks for your reply, though!
Motivation is the key to software development.
|
|
|
|
|
Just a thought, and post back please if you succeed because I am interested.
Check this solution Get Total Free Space Drive[^]
I have Vista and Nero with InCD Installed and I had tried over a dozen of code to get the capacity of the CD/DVD and I am getting an error.
Is that your case also?
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Nope, this example did not work aswell, because a CD never has any free space. The maximumsize is simply the size of the data burnt on the cd/dvd.. And yes, this is my case aswell. I can't find ANY solution on how to determine the real capacity of a DVD or CD nor can I find a solution on how to see whether the inserted medium is a DVD or CD. I'm totally stuck..
Cheers,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Hi All,
Recently i upgraded my vb.net 2005 application to vb.net 2008 and facing a problem.
i have used crystal reports as reporting tool. it works fine in current and earlier.
when see a report it also works fine but when i closed it and open another win form not having crystal reports the MainMenu goes missing. i could not understand why it is happened.
i am using (Vista 64 bit).
kindly help me.
Thanks in advance
rmshah
Developer
|
|
|
|
|
I would like to show a sample of a Font from an uninstalled Font file.
|
|
|
|
|
Hi,
I haven't used it yet but AFAIK .NET provides a PrivateFontCollection class for such purposes.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Thank you very much
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|