var imagedata:bytearray=new bytearray();
var headshotstation:sqlstation=new sqlstation();
headshotstation.sqlconnection=dbconnection;
var headshotstr:string=“从ac_images中选择headshot,其中id=”+idx;
headshotstation.text=headshotstr;
headshotstation.execute();
< /代码>
错误引用了此块中的最后一行。我在网上找到了一些参考资料,人们无法使用从外部程序插入数据的AS3来选择blob,这正是我的确切情况。
准确的错误跟踪是:
rangeerror:error 2006:提供的索引超出界限。
在flash.data::sqlstation/internalexecute()时
在flash.data::sqlstation/execute()时
在edu.bu::datamanager/getHeadshotImageData()[省略/datamanager.as:396]
在edu.bu::customstudentprofileeditorwindow/edistudent()[省略/customstudentprofileeditorwindow.mxml:194]
在edu.bu::customstudentprofileeditorwindow/profileeditor_completehandler()[省略/customstudentprofileeditorwindow.mxml:37]
在edu.bu::customstudentprofileeditorwindow/uuu customstudentprofileeditorwindow_window1_creationcomplete()[省略/customstudentprofileeditorwindow.mxml:9]
在flash.events::EventDispatcher/DispatcheventFunction()时
在flash.events::EventDispatcher/Dispatchevent()时
在mx.core::uicomponent/dispatchevent()[e:\dev\4.x\frameworks\projects\framework\src\mx\core\uicomponent.as:12528]
at mx.core::uicomponent/set initialized()[e:\dev\4.x\frameworks\projects\framework\src\mx\core\uicomponent.as:1627]
在mx.managers::layoutmanager/dophasedinstantiation()[e:\dev\4.x\frameworks\projects\framework\src\mx\managers\layoutmanager.as:759]
在mx.managers::layoutManager/DopHasedInstationCallback()[e:\dev\4.x\frameworks\projects\framework\src\mx\managers\layoutManager.as:1072]
< /代码>
有什么想法会导致AS3窒息的数据有什么问题吗?
edit:I've tryed to insert the same data into a binary type field using sqlite manager 3.5 for os x with the same result.我正在使用JPG,打算尝试其他图像格式,但我不能开始猜测提供的索引是否越界,因为尝试跳转到定义只是说明它是从SWC获取的,我看不到。在我将数据分发到压缩包中并动态解压缩之前抓取吸管,这是我不想做的。
edit 2,workaround edition:现在,我已经编写了一个快速MXML窗口,提示输入图像并将数据插入数据库。仍然想知道为什么另一个应用程序不能以sqlstation理解的方式存储blob数据。我基本上设置了几个按钮,它们提示我在数据库中需要的图像的文件路径,用readbytes()将其读取到bytearray,并使用sqlStatement将其存储到sqlite db中。然后,我就可以轻松地读回图像。
edit 3:here is an image of the table structure.注意,当我使用flash执行数据库映像插入时,这个表正被成功使用,而不是其他一些工具,它将数据正确地存储在blob字段中,用于除flash之外的其他每个应用程序…

错误引用了此块中的最后一行。我在网上找到了一些参考资料,人们无法使用从外部程序插入数据的AS3来选择blob,这正是我的确切情况。
准确的错误跟踪是:
RangeError: Error #2006: The supplied index is out of bounds.
at flash.data::SQLStatement/internalExecute()
at flash.data::SQLStatement/execute()
at edu.bu::DataManager/getHeadshotImageData()[omitted/DataManager.as:396]
at edu.bu::CustomStudentProfileEditorWindow/editStudent()[omitted/CustomStudentProfileEditorWindow.mxml:194]
at edu.bu::CustomStudentProfileEditorWindow/profileEditor_completeHandler()[omitted/CustomStudentProfileEditorWindow.mxml:37]
at edu.bu::CustomStudentProfileEditorWindow/___CustomStudentProfileEditorWindow_Window1_creationComplete()[omitted/CustomStudentProfileEditorWindow.mxml:9]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:12528]
at mx.core::UIComponent/set initialized()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1627]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:759]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]
有什么想法会导致AS3窒息的数据有什么问题吗?
编辑:我尝试使用SQLite Manager 3.5 for OS X将相同的数据插入二进制类型字段,结果相同。我正在使用JPG,打算尝试其他图像格式,但我不能开始猜测提供的索引是否越界,因为尝试跳转到定义只是说明它是从SWC获取的,我看不到。在我将数据分发到一个压缩包中并在运行中对其进行解压缩之前抓取吸管,这是我不想做的。
编辑2,解决方案版本:现在,我已经编写了一个快速的MXML窗口,它提示输入图像并将数据插入数据库。仍然想知道为什么另一个应用程序不能以sqlstation理解的方式存储blob数据。我基本上设置了几个按钮,它们提示我在数据库中需要的图像的文件路径,用readbytes()将其读取到bytearray,并使用sqlStatement将其存储到sqlite db中。然后我就可以毫不费力地读回图像了。
编辑3:这是表格结构的图像。注意,当我使用flash执行数据库映像插入时,这个表正被成功使用,而不是其他工具,它将数据正确地存储在blob字段中,用于除flash之外的其他每个应用程序…
