idx = document.getElementById("odbclist").selectedIndex
strDriver = "{" & document.getElementById("odbclist").options(idx).text & "}"
strServer = document.getElementById("p03").value
strUser = document.getElementById("p01").value
strPass = document.getElementById("p02").value
strTable = document.getElementById("p04").value
strDb = document.getElementById("db_name").value
strFile = document.getElementById("db_file").value
ConnectionString = _
"Provider=MSDASQL" & _
";Driver=" & strDriver
if strFile <> "" then
ConnectionString = ConnectionString & ";Dbq=" & strFile
end if
if strServer <> "" then
ConnectionString = ConnectionString & ";Server=" & strServer
end if
if strDb <> "" then
ConnectionString = ConnectionString & ";Database=" & strDb
end if
if strUser <> "" then
ConnectionString = ConnectionString & ";UID=" & strUser
end if
if strPass <> "" then
ConnectionString = ConnectionString & ";PWD=" & strPass
end if
ConnectionString = ConnectionString & ";"
if document.getElementById("connectopt").value <> "" then
ConnectionString = _
ConnectionString & document.getElementById("connectopt").value & ";"
end if