|
I was trying to reset or clear Cookie values, not the entire cookie for which I am setting. So the issue is when I try to process the transaction on Page 1 and go to the Page 2 and come back to Page 1 it is good (for the first time) but however when again I try to make some changes in Page 1 and go to the Page 2 and come back to Page 1 it is showing me the first selected values. The issue is the cookie values are not getting cleared (after the first time) or getting reset for the second transaction (second time). There are two different methods are being called Page_Load and SavePage so Next button will trigger SavePage method and when I try to come back to Page 1 Page_load is getting fired. The code I used in the both methods are.
Can anyone please help me resetting the cookie values or clearing the cookie values for the first after setting. Thanks.
Page_Load Method
blnCSRVerify = CBool(If(chkCSRVerify.Checked = True, 1, 0))
blnCustomerDecline = CBool(If(chkCustomerDecline.Checked = True, 1, 0))
If CustomerCookie.IsCSRVerify Then
chkCSRVerify.Checked = True
End If
If CustomerCookie.IsCustomerDecline Then
chkCustomerDecline.Checked = True
End If
If CustomerCookie.IsSurrenderCredentials <> const_DefaultValForSurrCred Then
If CBool(CustomerCookie.IsSurrenderCredentials) OrElse CBool(optlstVerification.YesSelected) Then
optlstVerification.SelectedValue = CStr(1)
Else
optlstVerification.SelectedValue = CStr(0)
End If
End If
SavePage()
Dim blnCSRVerify As Boolean = False
Dim blnCustomerDecline As Boolean = False
blnCSRVerify = CBool(If(chkCSRVerify.Checked = True, 1, 0))
blnCustomerDecline = CBool(If(chkCustomerDecline.Checked = True, 1, 0))
Dim objContext As HttpContext = HttpContext.Current
Dim objCustomerCookie As HttpCookie = objContext.Request.Cookies("StarsCustomer")
If blnCSRVerify Then
objCustomerCookie.Values.Set("CSR_Verify", CStr(blnCSRVerify))
End If
If blnCustomerDecline Then
objCustomerCookie.Values.Set("CustomerDecline", CStr(blnCustomerDecline))
End If
objCustomerCookie.Values.Set("SurrenderCredentials", optlstVerification.SelectedValue.ToString)
objContext.Response.Cookies.Add(objCustomerCookie)
|
|
|
|
|
Hi,
The HttpContext.Request.Cookie is what's come from client. It will not be automatically sent back to client.
Try changing the value in HttpContext.Current.Response.Cookies collection and set the value. The changed value should be reflected in subsequent request.
|
|
|
|
|
Hi! this is Hamza Arshad. i'm facing a problem with visual basic. Cannot insert explicit value for identity column in table 'Student' When IDENTITY_INSERT is set to OFF.
This is the error. Can anyone help me fix this please. Thanks
|
|
|
|
|
As the error quite clearly says, you have a SQL Server table with an IDENTITY column. Your code is trying to insert an explicit value into that column. You cannot do that.
The solution is simple: don't include the IDENTITY column in your INSERT statement. SQL will assign the next available value, which you can retrieve by using the SCOPE_IDENTITY function.
IDENTITY (Property) (Transact-SQL) | Microsoft Docs[^]
SCOPE_IDENTITY (Transact-SQL) | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
no! i'm not inserting id explicitly but still its giving this error
|
|
|
|
|
Well, given the choice between believing you when you say you're not, and believing the error message which says you are, I know which option my money's on!
Even if you think you're not inserting a value in the IDENTITY column, the error message very clearly tells you that you are.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I'm downloading a large file (+330mb) and getting a memory error (
Not enough storage is available to complete this operation. ) when I assign the response to a byte array (works fine with smaller files <300mb).
I thought I would have been able to download up to 2gb files, so don't know why the error happens.
I have 4gb of memory on my PC and I'm using VB6 under Windows 7.
The arror occurs when I assign the response to the byte array (variable name 'bytFile')
The code is as follows:
Public Function Downloadfile(ByVal vstrName As String) As Boolean
On Error GoTo Handler
Dim bytFile() As Byte
Dim objADO As ADODB.Stream
gstrURL = "https://...URL..../"
vstrName = "LargeFile.zip"
gstrProxyIP = "99.999.9.9:80"
gstrUserID = "userid"
gstrPassword = "password"
gstrZipPath = "d:\"
gstrFile = "LocalSavedFile.zip"
Set greqPFA = New WinHttp.WinHttpRequest
greqPFA.SetProxy 2, gstrProxyIP
greqPFA.SetTimeouts 500000, 500000, 500000, 500000
greqPFA.Open "GET", gstrURL & vstrName, False
greqPFA.SetCredentials gstrUserID, gstrPassword, 0
greqPFA.SetRequestHeader "Content-Type", "text/html; charset=UTF-8"
greqPFA.Send
bytFile = greqPFA.ResponseBody
Set greqPFA = Nothing
Set objADO = New ADODB.Stream
objADO.Type = adTypeBinary
objADO.Open
objADO.Write bytFile
objADO.SaveToFile gstrZipPath & gstrFile, SaveOptionsEnum.adSaveCreateOverWrite
objADO.Close
Set objADO = Nothing
Downloadfile = True
Exit Function
Handler:
Downloadfile = False
End Function
Any thoughts?
|
|
|
|
|
Member 13286611 wrote: Any thoughts? Yes. You should upgrade to VB.NET, as VB6 is no longer supported.
There is also no reason not to. VB.NET is available for free, and would work happily with Win7.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
how to add check box in datagrid in VB 6.0
|
|
|
|
|
The only correct answer is "you don't". VB6 is no longer supported.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello guys .....i am actually new to VB and am trying to create a system which must be used by teachers to grade pupils marks that is if a teacher imputs a mark in the system it must show whetehr the mark grade is an A GRADE OR B GRADE , OR U GRADE so ........can you help me ASAP
|
|
|
|
|
Help you how? Show what you have done and where you are stuck. If you are really new to VB then maybe you would be better studying a book or online tutorials first, see introduction to vb.net - Google Search[^].
|
|
|
|
|
I an running Windows 10 Home edition on a 64-bit machine with 16gb of memory. Windows Build version 1703 Build # 15063.413
On Jun 15-16 a notification popped up on my screen indicating that Windows need to do some prep work for the upcoming Windows Creator update. I responded affirmatively and there after Windows installed an update which took several hours.
Now all of a sudden Visual Studio 2010 has started crashing when loading a solution/project or executing a project.
This does not happen every time. Also Visual Studio seems to take longer to load and when building/compiling a project it seems to take a lot longer.
I reinstalled Visual Studio 2010 but that did not seem to help.
Has anyone experienced similar problems?
|
|
|
|
|
hello everyone.
i need some help, i have a problem on my project in my Visual basic 6.0 like this
run-time error '-2147467259 (80004005)': [Mysql] [ODBC.51 driver] [mysqld-5.6.0] no database selected
|
|
|
|
|
VB 6 is no longer supported!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Member 13265037 wrote: no database selected There is a clue in that message.
|
|
|
|
|
I looked at program that counts the line and
vbproj tree
vbproj
vbprojinf
maybe I am searching for the wrong thing or using wrong words when searching but.
I have a program that has a lot of text boxes and list boxes and it works. i just need to be able to unhide or hide or make it visible not visible but I not know which is which in the frames. the codes has like 10,000 lines or or around there. been using it for years. Thanks.
|
|
|
|
|
Yes, it's possible, but not simple. If you have the source code then it would be much simpler to modify that.
|
|
|
|
|
Thank you for the quick response.
I downloaded a program that counts lines in a vb6 projects but I wish to exposes the containers in a running vb6 IDE.
I not want people to do the work for me. I want to learn and do as I go. I tried active dll and activeX thinking to hook into exposed properties of the running vb6 IDE. if you know of a program or a partial program that attempts to do that then maybe it will show me something I not think of before. what would you do. (If possible point me in the correct direction or where to look and learn. What I am trying to do is to open and run the program and then run the 2nd program which is compiled which will look in the first vb6 IDE running program and look for the exposed properties in the vb6 IDE running and turnoff frames or makes invisible or this way because it is running the results are almost right away and I can see where the controls are and decide what to do with it. I hope I am not too confusing. Sorry I am deaf and really not use speak English. I used vb3 to vb6. Used Dos all the way to windows 10. Will continue to look and ask around and read vb6 programming books in pdf formats.
|
|
|
|
|
|
Looked at the reflect in net framework and I ran into several (lack of better word) widgets or sample or tutorials for vb6 acting like reflections for network frame. I have download some codes from programmer heaven and DevC and and getting the idea if there is a word thundervb then I can grab it and put it in a list box and then once that is done, make another form for each control that I listed and repeat. Once I get that done then I can try to exposes the property. I found another program open source vb6 written program that will send message to the picked window and control. Hopefully I can change visible true or false and change the frames visible true or false and change the command buttons visible true or false. If you want, I can send you the file and stuff i found and maybe you can give me an idea. If you know of any Api text file to explain deep explain. please let me know where to down load that. Thank you for all you teach.
|
|
|
|
|
Sorry, I have not looked at VB6 for ever 20 years, and it is long dead as a development language, so you are largely on your own. Google is the place to search for other resources.
|
|
|
|
|
No problem sir, but thank you for your time and efforts. Hopefully i get somewhere. Will post if I do.
|
|
|
|
|
Hello,
I use this code to try to sort my desktop icons, but noway...
'Declaration
'-------------
'API declarations
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
LPARAM As Any) As Long
Public Const LVS_SORTASCENDING = &H10
Public Const LVM_SORTITEMS = (LVM_FIRST + 48)
'and others declarations...
'code in sub procedure
'---------------------
Public Sub sortIconsByNameAsc()
h = GetDesktopWindow() 'hwnd for desktop
Call SendMessage(h, LVM_SORTITEMS, LVS_SORTASCENDING, h)
end sub
|
|
|
|