Ir para conteúdo
Fórum Script Brasil

LUCIANO FARIA

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Tudo que LUCIANO FARIA postou

  1. Pessoal, estou com um banco de dados do ACCESS que tenho uma conexão com SQL, nesta conexão estou buscando alguns dados utilizando uma OpenQuery é quero inserir em uma TABELA NO ACCESS que eu CRIEI com o Nome TBL_QUERY, porem está ocorrendo o erro de sintaxe, alguém pode me ajudar????????? strSQL = " Select * from openquery (click,'select hd.w6key as Key, hd.revision REVISAO, hd.name, hd.hierarchyid, hd.hierarchylevel, hd.referenceelement, hd.tplatitude, hd.tplongitude, wz.name WORKINGAREA, hd.derivationid, hd.state, hd.maxdistance, hd.stamp_timemodified as DataAlteracao " & _ " from w6.w6h hd " & _ " left join w6.w6am dte on dte.preid = hd.hierarchyid " & _ " left join w6.w6area dsa on dsa.w6key = dte.subareaparent " & _ " left join w6.w6tarea da on da.w6key = dsa.areaparent " & _ " left join w6.w6tta dt on dt.w6key = da.taparent " & _ " left join w6.w6ny dc on dc.w6key = dt.companyparent " & _ " left join w6.w6ts dd on dd.w6key = dc.districtparent " & _ " left join w6.w6ns dr on dr.w6key = dd.regionparent " & _ " left join w6.w6Type st on hd.type = st.w6key " & _ " left join w6.w6ory tt on hd.ory = tt.w6key " & _ " left join w6.w6zone wz on hd.workingarea = wz.w6key " & _ " where dr.preid in (''XPO'') or hd.state in (''XTPO'')order by hd.state')" Set RS = cn.Execute(strSQL) INSERT INTO (KEY[,REVISAO[,NAME[,hierarchyid]]])] in TBL_QUERY SELECT [RS.]KEY[,REVISAO[,NAME[,hierarchyid]]] FROM RS
×
×
  • Criar Novo...