adodb

“Not enough storage is available to complete this operation” when base64-encoding a zip file

邮差的信 提交于 2019-12-11 11:59:17
问题 The below code is for converting a zip file to base64 format. Dim inByteArray, base64Encoded, Const TypeBinary = 1 inByteArray = readBytes("F:path/file.zip") base64Encoded = encodeBase64(inByteArray) Private Function readBytes(file) Dim inStream ' ADODB stream object used Set inStream = CreateObject("ADODB.Stream") ' open with no arguments makes the stream an empty container inStream.Open inStream.Type = TypeBinary inStream.LoadFromFile(file) readBytes = inStream.Read() End Function Private

Query Pipe Delimited File Not Returning all Records

馋奶兔 提交于 2019-12-11 11:58:33
问题 I am querying a pipe delimited text file using VBA with ADODB. I have tried using both the ACE and JET engines, but the results are the same, and not correct. I saved a "schema.ini" file in the directory telling the engine that the file is pipe delimited. When the query finishes though, I have data that shifted columns and other fields that are blank when I can see the data in the text file. I use the CopyFromRecordset method to transfer the results to my workbook. Can anyone see something

ADODB error handling variable not setting

限于喜欢 提交于 2019-12-11 10:36:32
问题 I building an ADODB error trap but for some reason, by errSQL.Number and errSQL.Description both give me a "Object variable or With Block variable not set." error....here is my code so far...I have the active x object enabled and I thought that .number and .description are correct...any help would be awesome! The query I'm running also purposely will send an error. When I comment the error trap out, I do get a message box with a SQL syntax error but can't seem to trap it like below... Public

How to dispose ADODB.Command object in code migrated to VB.NET

£可爱£侵袭症+ 提交于 2019-12-11 10:19:20
问题 We migrated some obsolete code from VB6 to VB.net and the previous code used ADODB for connecting to oracle. Below is how the code looks like Dim cmd As New ADODB.Command ' stored procedures execution here cmd = Nothing // I want to dispose this cmd Object Nothing worked in VB6 but its creating lot of trouble with .NET there are open cursors on database. I know we should use the latest library and get rid of ADODB but for now is there a way I can dispose this object. I tried cmd.Dispose() but

using a multi-value Lookup field in a WHERE clause under ADODB

你说的曾经没有我的故事 提交于 2019-12-11 10:03:05
问题 How do you select rows based on a multi-value Lookup field in an Access database? The below ASP code returns no value when using multi-data column: <% Dim Contractors Dim Contractors_cmd Dim Contractors_numRows Set Contractors_cmd = Server.CreateObject ("ADODB.Command") Contractors_cmd.ActiveConnection = MM_Listings_STRING Contractors_cmd.CommandText = "SELECT * FROM Contractor WHERE UserStatus = 'Active' AND AgentID= "& Session("AgentID") Contractors_cmd.Prepared = true Set Contractors =

ADODB RecordSet to string variable VBA

非 Y 不嫁゛ 提交于 2019-12-11 10:00:23
问题 Quick question about ADODB recordset. I want to extract a query result from a recordset and set it to a string variable: query = "SELECT Value1 FROM Table" RS = New ADODB.Recordset RS.Open(query,Conn) The query is always going to return 3 values. I want take to assign these three values to a variable. RS.GetString returns the query results tab delimited, but I want to be able to iterate through this set and assign each row result to its own variable. Any ideas? Thanks in advance! 回答1: You can

How to retrieve autonumbered field via ADODB

谁说胖子不能爱 提交于 2019-12-11 09:57:13
问题 Context: MS Access and JScript I have a table into which I insert one field's worth of data so that the autonumber will fire and give me that record's unique id, viz oConn.Execute( "INSERT INTO tbl (DateTimeStamp) VALUES (" + newNow + ");"); in this case, newNow is a Double value which is automagically coerced into a Date. Once that's done, I would like to retrieve the autonumbered ID field which should have been filled at the point of INSERT. Up until now I've been using ADODB.Recordset for

Access (ADO) query between two hour ranges

有些话、适合烂在心里 提交于 2019-12-11 08:47:39
问题 Using VB to query an access .mdb database via ADODB. My date column holds both date and time, I would like to to build a query which will ignore the date, and refer only to the time in that column, in such a way, that will enable me to return records that have their time in between a range given by the user, ignoring the date. I tried selecting between numbers, but I believe access I'm doing it wrong ...WHERE [Date_Time_Of_Birth] Between #04:00:00# and #06:00:00# Just doesn't work as intended

How do I setup an ADODB connection to SQL Server 2008 in Microsoft Access 2010?

末鹿安然 提交于 2019-12-11 08:24:21
问题 I just installed SQL Server 2008 on my laptop. I also have Microsoft Access 2010 installed. Using VBA, I am trying to create an ADODB connection to my own database on SQL Server but I'm having trouble finding the right line of code: When I use this below, it doesn't work. The name of my computer is LAPTOPX and the database is HomeSQL. I am sure it's super easy but since I'm just starting out I can't seem to find the right way to ask the question. Thanks! Dim DBCONT As Object Set DBCONT =

How to reconnect in php adodb after exceptions: Mysql server gone away or Lost connection to MySQL server during query

﹥>﹥吖頭↗ 提交于 2019-12-11 08:18:28
问题 I have problem in one of my cron jobs, sometimes I get error like: MySQL server gone away and sometimes Lost connection to MySQL server during query. On random query's. I using ADODB, and connecting to database with function: function connectDatabase() { $this->database = NewADOConnection(DSN); $this->database->SetFetchMode(ADODB_FETCH_ASSOC); } and in cron job I doing something like that: while($arrRow = $result->fetchRow()){ try { /* Some MySQL query's (~10 query's) */ } catch(Exception $e)