Excel is being closed while connecting to Oracle using VBA -
i trying connect oracle using excel vba when code run, excel closed , reopened @ line msgbox rs.recordcount
sub ora_connection() dim con adodb.connection dim rs adodb.recordset dim query string set con = new adodb.connection set rs = new adodb.recordset on error goto final1 query = "select * emp emp_no='998234'" strcon = "driver={oracle in oraclient11g_home1};dbq=smqa;uid=myuserid;pwd=mypassword;" con.open (strcon) rs.cursortype = 1 rs.open query, con rs.movelast msgbox rs.recordcount rs.close set s = nothing con.close set con = nothing final1: msgbox err.number & " " & err.description end sub
i running code on windows 7 , trying connect oracle 11g. need additional setup connect oracle db using excel vba or wrong in code?
Comments
Post a Comment