SQL ExcelSQL Excel

Freeware Excel Add-In - Simplify data retrieval from SQL Server, Oracle, Sybase, MySQL, DB2, Firebird and any other ODBC compliant database

SQL Excel Support
Welcome, Guest
Please Login or Register.    Lost Password?
Place to post about any general type of issue, bug or question you have about SQL Excel.
Go to bottom Post Reply Favoured: 0
TOPIC: Updating
#66
blitzoff (User)
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Gender: Male gerwinvaatstra@hotmail.com Location: The Netherlands Birthdate: 1987-06-10
Updating 7 Months, 1 Week ago Karma: 1  
The version check is not right. It says there is a new version, but there isn't. Your HTML says version 1.20. So its an older version. The check should see that, but it says there is a new version (probably you check if its the same ELSE a new version?)

Just to let you know .
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#70
admin (Admin)
Admin
Posts: 175
graph
User Online Now Click here to see the profile of this user
Re:Updating 7 Months, 1 Week ago Karma: 1  
Hi Blitzoff

Thanks a million for all the posts. Great ! It was a bit like a ghost town in here

This update is weird. I have to look at it this morning. It is only a simple check and I did test it well I thought. I am guessing the function which reads thes application version from the site is failing (and defaulting to 0 for some reason). It never happened on any test machine though..

The basic check is below..

If dLatestVersion > CDbl(App.Major & "." & App.Minor) Then
MsgBox "There is a new version of SQL Excel........"
Else
MsgBox "SQL Excel is uptodate", vbInformation, gAPP_TITLE
End IF


I will look into this in a little bit. Back soon..
Thanks very much for all the help. Will be back on your other posts..
Al
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/29 07:14 By admin.
  The administrator has disabled public write access.
#73
admin (Admin)
Admin
Posts: 175
graph
User Online Now Click here to see the profile of this user
Re:Updating 7 Months, 1 Week ago Karma: 1  
Hi Again Blitzoff, sorry for all the messages.. I took a look at the application version check and I could not find a problem. It seems to be working ok for me.

Please, if it is ok, could you try to run the following from an Office VBA module ? If you can't no problem.. I will find the prob one way or another but it will be great if you can take a look

To run it from a VBA module, you can do an ALT F11 from Excel and then insert a module and then paste in the code below.. The code is a slimmed down version of the addin version but it is the same really. To run it select a line within the Sub Check_App_Version() and hit f5. Sure you know that already but just in case..

Sorry to ask you to take a look but it will be a big help if you can let me know if this works.. IF you have any questions at all please let me know..

Thanks a million, Al


//START PASTING BELOW THIS LINE
Private Declare Function InternetOpen Lib "wininet.dll" _
Alias "InternetOpenA" (ByVal sAgent As String, _
ByVal lAccessType As Long, ByVal sProxyName As String, _
ByVal sProxyBypass As String, ByVal lFlags As Long) As Long

Private Declare Function InternetOpenUrl Lib "wininet.dll" _
Alias "InternetOpenUrlA" (ByVal hOpen As Long, _
ByVal sUrl As String, ByVal sHeaders As String, _
ByVal lLength As Long, ByVal lFlags As Long, _
ByVal lContext As Long) As Long

Private Declare Function InternetReadFile Lib "wininet.dll" _
(ByVal hFile As Long, ByVal sBuffer As String, _
ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) _
As Integer

Private Declare Function InternetCloseHandle _
Lib "wininet.dll" (ByVal hInet As Long) As Integer

Public Function OpenURL(ByVal sUrl As String) As String
Dim hOpen As Long
Dim hOpenUrl As Long
Dim bDoLoop As Boolean
Dim bRet As Boolean
Dim sReadBuffer As String * 2048
Dim lNumberOfBytesRead As Long
Dim sBuffer As String
Dim Query As String
Dim fullstring As String

hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
Query = ""
hOpenUrl = InternetOpenUrl(hOpen, sUrl, vbNullString, 0, INTERNET_FLAG_RELOAD, 0)

bDoLoop = True

While bDoLoop
sReadBuffer = vbNullString
bRet = InternetReadFile(hOpenUrl, sReadBuffer, Len(sReadBuffer), lNumberOfBytesRead)
sBuffer = sBuffer & Left$(sReadBuffer, lNumberOfBytesRead)
If Not CBool(lNumberOfBytesRead) Then bDoLoop = False
Wend

If hOpenUrl <> 0 Then InternetCloseHandle (hOpenUrl)
If hOpen <> 0 Then InternetCloseHandle (hOpen)
OpenURL = sBuffer

End Function

Sub Check_App_Version()
Dim sSearchresults As String, sUrl As String, sVersion As String
Dim dLocalVersion As Double

sUrl = "http://www.sqlexcel.net/ApplicationVersion.html"
sSearchresults = OpenURL(sUrl)

sVersion = Mid(sSearchresults, 13, 4)
dLocalVersion = CDbl(sVersion) '//REMOTE VERSION SHOULD READ as 1.2

If dLocalVersion > "1.2" Then '//HARD CODED THIS TO BE 1.2 (in app, it used app.major , app.minor
MsgBox "There is a new version of SQL Excel available for download." & Chr(13) & "When you can, Please go to www.sqlexcel.net to download it."
Else
MsgBox "SQL Excel is uptodate", vbInformation, "SQL Excel"
End If

End Sub

//END PASTING ABOVE THIS LINE
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/29 10:50 By admin.
  The administrator has disabled public write access.
#75
blitzoff (User)
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Gender: Male gerwinvaatstra@hotmail.com Location: The Netherlands Birthdate: 1987-06-10
Re:Updating 7 Months, 1 Week ago Karma: 1  
Hmm, weird. Now I get a type mismatch (normal check and also in de VBA check). Ill have a look at it tommorow.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#82
admin (Admin)
Admin
Posts: 175
graph
User Online Now Click here to see the profile of this user
Re:Updating 7 Months, 1 Week ago Karma: 1  
There is something strange going on here. No clue what it is though.
But please let me know how it goes Blitzoff.. I hope you find the problem on that.

Have a good night there. Thanks for all the help.
Al
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#86
blitzoff (User)
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Gender: Male gerwinvaatstra@hotmail.com Location: The Netherlands Birthdate: 1987-06-10
Re:Updating 7 Months, 1 Week ago Karma: 1  
Both give me the same result. There is a new version which i can download at sqlexcel.net (both VBA and normal check).
But you say somewheren on the site that it checks the version on http://www.sqlexcel.net/ApplicationVersion.html. There it is 1.20

I don't know why.. but its not working. I have excel 2003 SP3.

If needed I can test it on 2007 at home sometime
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#87
admin (Admin)
Admin
Posts: 175
graph
User Online Now Click here to see the profile of this user
Re:Updating 7 Months, 1 Week ago Karma: 1  
Hya

You are right with the Application_Version. 1.2 is correct

I am sorry for this problem. If it is ok, I will split down the VBA routine into a number of disctinct steps with some kindof logging to a worksheet. This was if you can run the macro we can see where it breaks..
Maybe the line below is failing to read 1.2 for some weird reason.
sVersion = Mid(sSearchresults, 13, 4)

But it is very strange that the remote version would have a great number

Will look at this later this morning. Sorry again for this problem, Al
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#89
admin (Admin)
Admin
Posts: 175
graph
User Online Now Click here to see the profile of this user
Re:Updating 7 Months, 1 Week ago Karma: 1  
Hi !

I looked at this a bit more. If it is ok, can you run the macro in the attached workbook [Sorry, will have to send the file in direct as I cant attach an XLS in the forum..]

There is a button that will import the text string from the server. The imported string will show up in the yellow cell towards the top. Need to make sure this string is exactly what is shown in the picture below. If it is, then there seems to be a problem with the parsing of the string and there are a few forumulas below that will hopefully help figure this out.

The remote version should be 1.2. And you should see this value in cell B3
The local version is hard coded to 1.2 in Cell B3
Cell B9 has a forumla that will run the check. Basically the same as in the addin

I am very sorry to ask you to look but it will be a big help. I am planning a bug fix release this weekend. With some enhancements too and would like to make sure this works fine.. So hopefully we can figure this out.
Al

 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/30 09:50 By admin.
  The administrator has disabled public write access.
#92
blitzoff (User)
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Gender: Male gerwinvaatstra@hotmail.com Location: The Netherlands Birthdate: 1987-06-10
Re:Updating 7 Months, 1 Week ago Karma: 1  
Im sorry that i don't follow you exactly. I shall tell you what happened

I cleared the yellow thing. It filled with <html><body>1.20</body></html> - Seems Ok then
B6 (the one with Value(mid.....) Says #VALUE so thats not working really well
If i fill in 1.2.43 as local hard coded version (in the one without value function) it says i have to update. I've sended you a screenshot too.

Tell me, why is it that your Excel shows B6 correctly?


EDIT: I tested this in Excel 2007. I tested it with and without the plugin installed.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/30 12:32 By blitzoff.
  The administrator has disabled public write access.
#93
blitzoff (User)
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Gender: Male gerwinvaatstra@hotmail.com Location: The Netherlands Birthdate: 1987-06-10
Re:Updating 7 Months, 1 Week ago Karma: 1  
OK, so it says its not a number. If i change the code to 1,20 instead of 1.20, it works.

I don't know why it works for you.. Im not that smart in Excel . Maybe its a setting that i have wrong in Excel, but multiple people would have it wrong i guess.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#96
admin (Admin)
Admin
Posts: 175
graph
User Online Now Click here to see the profile of this user
Re:Updating 7 Months, 1 Week ago Karma: 1  
Thank a million. You found the prob. I was able to reproduce it on my machine.

It was my error with the parsing of the string.

I made a bad assumption that I could use the decimal point (.) as the seperator betwen the major and minor version. But that is wrong as users might have comma (,) as the seperator or something else. The delimeter is set up in the Windows Regional Settings form.. So when I changed it to "French" it failed. This would fail basically for alot of users...

Should not be hard to fix.

You were a very big help. Thanks for going through the hassle of testing it out.

There will be a minor release going through over the weekend and it will have this in it. I will try to include the pasting of the embedded query as well.

THANKS BLITZOFF !!!!!!!!!!!!!!!!!!!!!!!!
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Thanks for using the forum SQL Excel Freeware Add-inget the latest posts directly to your desktop

Google Translate

Copyright SQL Excel, 2007-2008 | valid xhtml? | valid CSS? |Microsoft ® and Microsoft Excel ® are registered trademarks of Microsoft Corporation