Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Error 3157 Oleinitiate: Too many open channels
Everything works fine just until I get the error Too many channels open at the line:
DI = rs.Fields("DI")Can somebody help me with it please ? Is there a different way to do it?
Here is my code:
dao = objectopen("DAO.DBEngine.35") ws = dao.CreateWorkspace "JetWorkspace","admin", "") db = ws.OpenDatabase("Logics.mdb") sqlstr = "SELECT * FROM LogicsInstall WHERE IpAdress = '%ipaddr%'" rs = db.openrecordset(sqlstr) ; Definition of the Logics Vars IPAddress = rs.Fields("Ipaddress") ElNumber = rs.Fields("ElNumber ") ElNumber2 = rs.Fields("ElNumber2") ElNumber3 = rs.Fields("ElNumber3") ElNumber4 = rs.Fields("ElNumber4") AG = rs.Fields("AG") BR = rs.Fields("BR") BYP = rs.Fields("BYP") CA = rs.Fields("CA") CCCS = rs.Fields("CCCS") CL = rs.Fields("CL") COP = rs.Fields("COP") CP = rs.Fields("CP") CPR = rs.Fields("CPR") CS = rs.Fields("CS") DDE = rs.Fields("DDE") DI = rs.Fields("DI") DIALOG_ = rs.Fields("DIALOG") DIALOG1 = rs.Fields("DIALOG1") DIALOG2 = rs.Fields("DIALOG2") DIALOG3 = rs.Fields("DIALOG3") DIALOG4 = rs.Fields("DIALOG4") EASY = rs.Fields("EASY") EPPR = rs.Fields("EPPR") FNS = rs.Fields("FNS") FOUR = rs.Fields("FOUR") GR = rs.Fields("GR") GTTP = rs.Fields("GTTP") LP = rs.Fields("LP") LPHC = rs.Fields("LPHC") MM = rs.Fields("MM") MONITL = rs.Fields("MONITL") OASE = rs.Fields("OASE") PC = rs.Fields("PC") PEN2 = rs.Fields("PEN2") PF = rs.Fields("PF") PHARM = rs.Fields("PHARM") PX = rs.Fields("PX") RA = rs.Fields("RA") RE = rs.Fields("RE") UDS = rs.Fields("UDS ")
ObjectClose the ones you don;t need any more.
The following reportedly seems to help. You might try a For...Next
flds = rs.fields nCnt = flds.Count() For i = 0 to nCnt -1 ; fields are 0-based field = rs.Fields(i) ; then do whatever Next
Article ID: W14680
Filename: Error 3157 Oleinitiate - Too many open channels.txt
File Created: 2000:07:17:11:00:26
Last Updated: 2000:07:17:11:00:26