|
This doesn't make any sense. You say you want to disable the Ctrl-P keys in your application, but if you don't provide the shortcut in your app yourself, Ctrl-P won't do anything anyway??
Wait a minute....Is this a Web Application (ASP.NET)??
|
|
|
|
|
am using vb6, am trying to add this Filed from a textbox, to the Extension filed in my database and when i try to Execute my Code it highlight this line and here is my whole code for that save button
It will higlight the Extension line
Private Sub cmdAdd_Click()
rrs("Num_key") = txtnumkey
rrs("EXTENSION") = txtextension
rrs("Actual_Extent") = txtactualextent
rrs("Lis_key") = txtliskey
rrs("Func_Key") = txtfunckey
rrs("Prop_Category_ID") = txtcategory
rrs("GEOCODE") = txtgeocode
rrs("Add_Date") = txtadddate
rrs("Add_user_ID") = txtadduserid
rrs.Update
cmdNew.Visible = True
cmdUpdate.Visible = True
cmdRefresh.Visible = True
cmdDelete.Visible = True
End Sub
Please Help
Vuyiswa
|
|
|
|
|
|
The Extension fiels is
"int" and it allow Null values, infect all the fields i have allow null values, and i have droped a textbox in my form and name it txtextension, i have checked it matched with the one in my code,i have bind it, i can scroll with recordset. but when i try to insert it gives me Problem, as the Filed Extension allows Null values ,If i dot enter anything it supposed to continue. Here is my code for all Buttons
*************************************
This is My Connection
*************************************
Set conn = New Connection
Set rrs = New Recordset
rrs.CursorLocation = adUseServer
rrs.CursorType = adOpenDynamic
rrs.LockType = adLockOptimistic
With conn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID =sde;Password=topology;" & _
"Data Source =SGIICORNETGS01;" & _
"Initial Catalog = Tshwane_Valuations"
.Open
End With
rrs.Open "select * from Property", conn
'Numkey
Set txtnumkey.DataSource = rrs
txtnumkey.DataField = "Num_key"
'Extension
Set txtextension.DataSource = rrs
txtextension.DataField = "Extension"
'Cell ID
Set txtcellid.DataSource = rrs
txtcellid.DataField = "Cell_ID"
'Actula Extent
Set txtactualextent.DataSource = rrs
txtactualextent.DataField = "ACTUAL_EXTENT"
'liskey
Set txtliskey.DataSource = rrs
txtliskey.DataField = "Lis_key"
'set txtfunckey
Set txtfunckey.DataSource = rrs
txtfunckey.DataField = "func_key"
'txtcategory
Set txtcategory.DataSource = rrs
txtcategory.DataField = "PROP_CATEGORY_ID"
'Geocode
Set txtgeocode.DataSource = rrs
txtgeocode.DataField = "GEOCODE"
'Add Date
Set txtadddate.DataSource = rrs
txtadddate.DataField = "ADD_DATE"
'User ID
Set txtadduserid.DataSource = rrs
txtadduserid.DataField = "ADD_USER_ID"
End Sub
********************************************************
Edit /Update
*********************************************************
Private Sub cmdUpdate_Click()
rrs.Update
rrs.MoveNext
If rrs.EOF = True Then
rrs.MoveLast
End If
End Sub
**********************************
and the rest
*********************************
Private Sub cmdAdd_Click()
rrs("Num_key") = txtnumkey
rrs("EXTENSION") = txtextension
rrs("Actual_Extent") = txtactualextent
rrs("Lis_key") = txtliskey
rrs("Func_Key") = txtfunckey
rrs("Prop_Category_ID") = txtcategory
rrs("GEOCODE") = txtgeocode
rrs("Add_Date") = txtadddate
rrs("Add_user_ID") = txtadduserid
rrs.Update
cmdNew.Visible = True
cmdUpdate.Visible = True
cmdRefresh.Visible = True
cmdDelete.Visible = True
End Sub
Private Sub cmdCancel_Click()
rrs.Cancel
End Sub
Private Sub cmdClose_Click()
Dim intresponse As Integer
intresponse = MsgBox("Do you want to Exit", vbYesNo, "Warning")
If intresponse = vbYes Then
Unload Me
ElseIf intresponse = vbNo Then
frmSingle2.Show
End If
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With rrs
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdFirst_Click()
rrs.MoveFirst
End Sub
Private Sub cmdLast_Click()
rrs.MoveLast
End Sub
Private Sub cmdNew_Click()
txtnumkey.Text = ""
txtextension.Text = ""
txtextension.Text = ""
txtcellid.Text = ""
txtcellid.Text = ""
txtactualextent.Text = ""
txtactualextent.Text = ""
txtliskey.Text = ""
txtliskey.Text = ""
txtfunckey.Text = ""
txtfunckey.Text = ""
txtcategory.Text = ""
txtgeocode.Text = ""
txtadddate.Text = ""
txtadduserid.Text = ""
cmdNew.Visible = False
cmdUpdate.Visible = False
cmdRefresh.Visible = False
cmdDelete.Visible = False
End Sub
Private Sub cmdNext_Click()
If rrs.EOF = True Then
rrs.MoveLast
Else
rrs.MoveNext
End If
End Sub
Private Sub cmdPrevious_Click()
rrs.MovePrevious
If rrs.BOF = True Then
rrs.MoveFirst
End If
End Sub
Private Sub cmdRefresh_Click()
rrs.Requery
End Sub
Private Sub cmdAdd_Click()
rrs("Num_key") = txtnumkey
rrs("EXTENSION") = txtextension
rrs("Actual_Extent") = txtactualextent
rrs("Lis_key") = txtliskey
rrs("Func_Key") = txtfunckey
rrs("Prop_Category_ID") = txtcategory
rrs("GEOCODE") = txtgeocode
rrs("Add_Date") = txtadddate
rrs("Add_user_ID") = txtadduserid
rrs.Update
cmdNew.Visible = True
cmdUpdate.Visible = True
cmdRefresh.Visible = True
cmdDelete.Visible = True
End Sub
Private Sub cmdCancel_Click()
rrs.Cancel
End Sub
Private Sub cmdClose_Click()
Dim intresponse As Integer
intresponse = MsgBox("Do you want to Exit", vbYesNo, "Warning")
If intresponse = vbYes Then
Unload Me
ElseIf intresponse = vbNo Then
frmSingle2.Show
End If
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With rrs
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdFirst_Click()
rrs.MoveFirst
End Sub
Private Sub cmdLast_Click()
rrs.MoveLast
End Sub
Private Sub cmdNew_Click()
txtnumkey.Text = ""
txtextension.Text = ""
txtextension.Text = ""
txtcellid.Text = ""
txtcellid.Text = ""
txtactualextent.Text = ""
txtactualextent.Text = ""
txtliskey.Text = ""
txtliskey.Text = ""
txtfunckey.Text = ""
txtfunckey.Text = ""
txtcategory.Text = ""
txtgeocode.Text = ""
txtadddate.Text = ""
txtadduserid.Text = ""
cmdNew.Visible = False
cmdUpdate.Visible = False
cmdRefresh.Visible = False
cmdDelete.Visible = False
End Sub
Private Sub cmdNext_Click()
If rrs.EOF = True Then
rrs.MoveLast
Else
rrs.MoveNext
End If
End Sub
Private Sub cmdPrevious_Click()
rrs.MovePrevious
If rrs.BOF = True Then
rrs.MoveFirst
End If
End Sub
Private Sub cmdRefresh_Click()
rrs.Requery
End Sub
Please help
Vuyiswa
|
|
|
|
|
A text box contains text - if you enter numbers in it and assign to a numeric field, VB will do an automatic conversion, but what happens if the text contains characters other than numbers? Converting the text to value is always a good idea when assigning to number type fields.
And an empty string is not a null value...
Hope this helps
|
|
|
|
|
Meaning that my code is correct i just need to make some conversions.?and please can you pleae comment on myConnection and my indivisual buttons , where should i improve and what is safe. Advice.
Thanks Man
Vuyiswa
|
|
|
|
|
i have managed to add data and save it, but whe i click on cmdPrevious
it show me this Error
"Row handles must all be relaeased before new ones can be obtained" hence this is a big database , did it save the record? and why that Error.
The code for First and Previous
Private Sub cmdPrevious_Click()
rrs.MovePrevious
If rrs.BOF = True Then
rrs.MoveFirst
End If
End Sub
Private Sub cmdFirst_Click()
rrs.MoveFirst
End Sub
and i get an Error when i try to Delete
"Either BOE or EOF is true or the Current Record has been Deleted Request Operation Requires Current record."
What suprises me is that i was scrolling through the recordset and i came across the blank record, so i was trying to delete it.Below is the code for delete
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With rrs
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Thank once more
Vuyiswa
|
|
|
|
|
hi,
i want to set the icon of my exe but a error arise for a particular image . Error is below
Error 1 Unable to write to output file 'C:\Documents and Settings\admin\Desktop\WindowsApplication1\WindowsApplication1\obj\Debug\WindowsApplication1.exe': The specified image file did not contain a resource section.
when i use favorites.ico file then above error occured but if i replace this icon file to other icon file then my application is running successfully. i have no idea about this error
thanks in advance
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
the file you are choosing, may be corrupted or some sort of fragmentation must have occurred...
|
|
|
|
|
The icon file isn't valid. There are a couple of applications out there that do NOT generate the proper format for an .ICO file, though, I can't remember what they are. This problem has come up before. The users ended up using a different package to create their icons.
|
|
|
|
|
hi.........
i want response very quickly if any one knows the ans for this query respond quickly....
i have two menus one is file menu and another is data menu
in file------>sub menu is load....there i used openfiledialog to select a particular file from the disk
and in data------->sub menu is run....there i used combo box in that i want the selected file which i already selected in load ..
is it possible .......using vb.net
thanks & regards.
-- modified at 1:52 Thursday 17th May, 2007
|
|
|
|
|
Please
1 - use meaningful headers. Hi..... doesn't cut it
2 - don't ask twice. Respond to one of the answers in your first post if you want to clarify or ask more
Now that you've described it, you just need to store the the filenames that have been selected before. It's a type of MRU, as far as I can see. Of course it is possible. Just decide where you want to store old file paths ( config file, registry, etc )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I was running an exe .
Now my question is , Can i programatically check whether the exe has been executed completely.
Does the framework class
System.Diagnosis.process has anything to do with the remedy of this problem?
|
|
|
|
|
well,you could enclose it in a try ..... catch and get the message of the exception and find out,if there is no exception message,then the file would have been executed 'completely'
|
|
|
|
|
is there ant alternative way out ?
once the program enters into the catch block.it takes time to complete the execution.thus increases the access time.
|
|
|
|
|
if you use a generic exception such as "Exception" it will take a lot of time,to reduce that time you have to choose a more specific exception.The more generic your exception,the more longer the processing time.So its a compromise between Accuracy and Speed.
|
|
|
|
|
i actually do not know how to check whether the particular exe has been executed completely.
|
|
|
|
|
What do you mean by "execute completely"?? Are you asking if the child process terminates? Are you looking for an exit code? A file waiting to be written?? What?
|
|
|
|
|
Is there a way to determine when i'm in runmode in vb6. I don't want to subclass a window when it is in design mode.
|
|
|
|
|
There's a way to determine when the program is running in the VB IDE context.
Are you asking for this?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
yes (i think). I have a usercontrol and in there i subclassed one of the constituent controls, but I only want this subclassing if i'm running and not while it is sited on a container in the design mode.
|
|
|
|
|
lee23 wrote: I have a usercontrol
Do you mean an ActiveX control?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
It's been a very long time since I've used VB6. But, I can't seem to recall if there was a property to tell if you're running in design mode or not. I don't think there is, but I could be wrong.
|
|
|
|
|
' code from Brad Buchanan
Public IsIDE As Boolean
Private Sub Form_Load()
IsIDE = False
'This line is only executed if
'running in the IDE and then
'returns True
Debug.Assert CheckIDE
'Use the IsIDE flag anywhere
If IsIDE Then
MsgBox ("Running under IDE")
Else
MsgBox ("Running as EXE")
End If
End Sub
Private Function CheckIDE() As Boolean
'This function will never be executed in an EXE
IsIDE = True 'set global flag
'Set CheckIDE or the Debug.Assert will Break
CheckIDE = True
End Function
|
|
|
|
|
I've tried this already and it doesn't do what i want. I want to know when my activex control is in run mode or design mode b/c i only want to do the subclassing when it is in run mode.
|
|
|
|