IvanCodin Posted December 27, 2008 Share Posted December 27, 2008 I am getting an error in my script. It points to a $GUI_SS_DEFAULT_LISTVIEW error and states it is possibly used before declaration. I looked at all of the include files and am not able to find a reference to the $GUI_SS_DEFAULT_LISTVIEW. Am I missing an include file perhaps? I just upgraded to the latest version if that makes a difference. Here is the code: CODE#include <GUIConstants.au3> #include "DBlistView.au3" Opt("GUIOnEventMode", 1) ; OnEvent mode Dim $title="Access db Viewer" ;gui title Dim $gui = GUICreate($title, 800, 600) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $DB=@ScriptDir & "\test.mdb" ;modify to location of your .mdb //does'nt handle relationships $Query="Select * From CompanyName Order by CompanyName ASC" ;modify your query $Number_of_Records_to_Display = 25 ;these variables are self explanitory... $Listview_Left = 50 $Listview_Top = 50 $Listview_Width = 400 $Listview_Height = 400 $Listview_style = $GUI_SS_DEFAULT_LISTVIEW ;default is -1 $Listview_exStyle = $LVS_EX_FULLROWSELECT + $LVS_EX_GRIDLINES ;default is -1 ;call the function _createDBlistView($DB,$Query,$Number_of_Records_to_Display,$Listview_Left,$Listview_Top,$Listview_Width,$Listview_Height,$Listview_style,$Listview_exStyle) GUISetState () While 1 Sleep(1000) ; Idle around WEnd Thanks CC Link to comment Share on other sites More sharing options...
Zedna Posted December 27, 2008 Share Posted December 27, 2008 (edited) CODE#include <ListViewConstants.au3> Edited December 27, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
IvanCodin Posted December 27, 2008 Author Share Posted December 27, 2008 (edited) Thanks for the suggestion! I always struggle when and what include in my scripts and when would they be required. I changed the script to included the ListViewConstants.au3 and still get the following error. AutoIt3 Syntax Checker v1.54.8 Copyright © Tylo 2007 E:\access\DBlistView.au3(18,58) : WARNING: $GUI_SS_DEFAULT_LISTVIEW: possibly used before declaration. $Listview_style = $GUI_SS_DEFAULT_LISTVIEW ;default is -1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ The error looked a little odd in that it points to my script directory and not the AutoIt include directory in c:\Porgram Files\AutiIt\Include directory. So I changed the include from #include "DBListView.au3" to #include <DBlistView.au3>. It now looks like it is using the correct file. Thanks for the assistance.! CC Edited December 27, 2008 by IvanCodin Link to comment Share on other sites More sharing options...
Zedna Posted December 27, 2008 Share Posted December 27, 2008 You must add #include <ListViewConstants.au3> into DBlistView.au3 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
IvanCodin Posted December 27, 2008 Author Share Posted December 27, 2008 (edited) It worked perfectly! Thank You! I now have a list displayed for the query. Why did you have me include ListViewConstants.au3 in DBListView.au3 and not my Main script? CC Edited December 27, 2008 by IvanCodin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now