Sign in to follow this  
Followers 0
Herb191

MSSQL to MySQL converter?

2 posts in this topic

Okay so quite a while back I thought I saw a AutoIt script that converted a MSSQL database to a MySQL database. I can’t seem to find it on the forums anywhere. Does anyone know if one exists? And if there is not an Autoit solution where I can find a good free converter. Thanks.

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Fhelipe
      By Fhelipe
      Nothing More
    • Patxi
      By Patxi
      Hello
      I have two function to convert  Latitude and longitude to UTM and vice versa 
      Examples of use:
      $utm_X= 607187.665391066 $utm_y= 4740057.65037195 $long=0 $lat=0 $x=0 $y=0 $utmz=30; UTM zone $SUR=False $DATUM=0 UTMtoGeog($utm_X,$utm_y, $long, $lat, $utmz, $SUR, $DATUM ) ConsoleWrite(" Lat: 42.805572 " & $lat & @CRLF) ConsoleWrite(" Long: -1.689084 " & $long & @CRLF) $lat = 42.805572 $long= -1.689084 GeogToUTM($lat, $long, $x, $y , $utmz, $SUR, $DATUM) ConsoleWrite(" X: 607187.665391066 607187.6 " & $x & @CRLF) ConsoleWrite(" Y: 4740057.65037195 4740057.6 " & $y & @CRLF) ConsoleWrite(" Zone: 30 " & $utmz & @CRLF) ConsoleWrite(" SUR: False " & $SUR & @CRLF) The DATUM could be:
           //Datum Info here: 
          ;~  0     //WGS 84    
          ;~     1    //NAD 83    
          ;~     2    //GRS 80    
          ;~     3    //WGS 72    
          ;~     4    //Australian 1965    
          ;~     5    //Krasovsky 1940    
          ;~     6    //North American 1927    
          ;~     7    //International 1924    
          ;~     8    //Hayford 1909    
          ;~     9    //Clarke 1880    
          ;~     10    //Clarke 1866    
          ;~     11    //Airy 1830    
          ;~     12    //Bessel 1841    
          ;~     13    //Everest 1830    
       
      I hope they'll be useful
      Func GeogToUTM($lat, $long, Byref $x, Byref $y , Byref $utmz, Byref $SUR, $DATUM=0) ;//Convert Latitude and Longitude to UTM ; With Latitud ($lat) and Longitud ($long) get UTM X ($x), UTM y ($y), UTM Zone ($utmz) and hemisphere ($SUR=False is North, $SUR=true is South) ; $DATUM by default is WGS 84 (0) ; Example of use: ; Local $lat, $long, $x, $y , $utmz, $SUR ; $lat = 42.805572 ; $long= -1.689084 ; GeogToUTM($lat, $long, $x, $y , $utmz, $SUR) ; ConsoleWrite("UTM X: " & $x & @CRLF) ; ConsoleWrite("UTM Y: " & $y & @CRLF) ; ConsoleWrite("UTM Zone: " & $utmz & @CRLF) ; ConsoleWrite("UTM hemisphere SUR: " & $SUR & @CRLF) ;~ //Datum Info here: Name, a, b, f, 1/f ;~ 0 //WGS 84 6,378,137.0 6356752.314 0.003352811 298.2572236 ;~ 1 //NAD 83 6,378,137.0 6356752.314 0.003352811 298.2572236 ;~ 2 //GRS 80 6,378,137.0 6,356,752.3 0.003352811 298.2572215 ;~ 3 //WGS 72 6,378,135.0 6,356,750.5 0.003352783 298.2597208 ;~ 4 //Australian 1965 6,378,160.0 6,356,774.7 0.003352895 298.2497323 ;~ 5 //Krasovsky 1940 6,378,245.0 6,356,863.0 0.003352333 298.2997381 ;~ 6 //North American 1927 6,378,206.4 6,356,583.8 0.003390075 294.9786982 ;~ 7 //International 1924 6,378,388.0 6,356,911.9 0.003367011 296.9993621 ;~ 8 //Hayford 1909 6,378,388.0 6,356,911.9 0.003367011 296.9993621 ;~ 9 //Clarke 1880 6,378,249.1 6,356,514.9 0.00340755 293.4660167 ;~ 10 //Clarke 1866 6,378,206.4 6,356,583.8 0.003390075 294.9786982 ;~ 11 //Airy 1830 6,377,563.4 6,356,256.9 0.003340853 299.3247788 ;~ 12 //Bessel 1841 6,377,397.2 6,356,079.0 0.003342774 299.1527052 ;~ 13 //Everest 1830 6,377,276.3 6,356,075.4 0.003324444 300.8021499 ; More information in: ; https://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM ; IMPORT from javascript version of: https://www.uwgb.edu/dutchs/UsefulData/ConvertUTMNoOZ.HTM ;Declarations(); Local $M_PI= 3.14159265358979323846 Local $DatumEqRad [14] = [6378137.0,6378137.0,6378137.0,6378135.0,6378160.0,6378245.0,6378206.4, 6378388.0,6378388.0,6378249.1,6378206.4,6377563.4,6377397.2,6377276.3]; Local $DatumFlat[14] = [298.2572236, 298.2572236, 298.2572215, 298.2597208, 298.2497323, 298.2997381, 294.9786982, 296.9993621, 296.9993621, 293.4660167, 294.9786982, 299.3247788, 299.1527052, 300.8021499]; Local $Item = $DATUM Local $k0 = 0.9996;//scale on central meridian Local $a = $DatumEqRad[$Item];//equatorial radius, meters. Local $f = 1/$DatumFlat[$Item];//polar flattening. Local $b = $a*(1-$f);//polar axis. Local $e = Sqrt (1 - ($b*$b)/($a*$a));//eccentricity Local $drad = $M_PI/180;//Convert degrees to radians) Local $latd = 0;//latitude in degrees Local $phi = 0;//latitude (north +, south -), but uses phi in reference Local $e0 = $e/Sqrt(1 - $e*$e);//e prime in reference ;; Creo que no hace falta y da error $N = $a/Sqrt(1-Math.pow($e*sin($phi)),2); Local $T = (Tan($phi)^2); Local $C = ($e*(cos($phi)^2)); Local $lng = 0;//Longitude (e = +, w = -) - can't use long - reserved word Local $lng0 = 0;//longitude of central meridian Local $lngd = 0;//longitude in degrees Local $M = 0;//M requires calculation ;$x = 0;//x coordinate ;$y = 0;//y coordinate Local $k = 1;//local scale ;$utmz = 30;//utm zone Local $zcm = 0;//zone central meridian Local $DigraphLetrsE = "ABCDEFGHJKLMNPQRSTUVWXYZ"; Local $DigraphLetrsN = "ABCDEFGHJKLMNPQRSTUV"; ;document.getElementById("EqRadBox").value = a; ;document.getElementById("PolRadBox").value = b; ;document.getElementById("FlatBox").value = f; ;document.getElementById("RecipBox").value = 1/f; ;Consolewrite ("EqRadBox " & $a & @CRLF) ;Consolewrite ("PolRadBox " & $b & @CRLF) ;Consolewrite ("FlatBox " & $f & @CRLF) ;Consolewrite ("RecipBox " & (1/$f) & @CRLF) Local $OOZok = false; ;Fin de Declarations ;$k0 = 0.9996;//scale on central meridian ;$b = a*(1-f);//polar axis. ;//alert(a+" "+b); ;//alert(1-(b/a)*(b/a)); ;$e = Math.sqrt(1 - (b/a)*(b/a));//eccentricity ;//alert(e); ;//Input Geographic Coordinates ;//Decimal Degree Option Local $latd0 = $lat ;parseFloat(document.getElementById("DDLatBox0").value); Local $lngd0 = $long; parseFloat(document.getElementById("DDLonBox0").value); ;latd1 = Math.abs(parseFloat(document.getElementById("DLatBox0").value)); ;latd1 = latd1 + parseFloat(document.getElementById("MLatBox0").value)/60; ;latd1 = latd1 + parseFloat(document.getElementById("SLatBox0").value)/3600; ;if (parseFloat(document.getElementById("DLatBox0").value)<0){latd1=-latd1;} ;lngd1 = Math.abs(parseFloat(document.getElementById("DLonBox0").value)); ;lngd1 = lngd1 + parseFloat(document.getElementById("MLonBox0").value)/60; ;lngd1 = lngd1 + parseFloat(document.getElementById("SLonBox0").value)/3600; ;if (parseFloat(document.getElementById("DLonBox0").value)<0){lngd1=-lngd1;} $lngd=$lngd0; $latd=$latd0; ;if(isNaN(latd)){ ;latd = latd1; ;document.getElementById("DDLatBox0").value = Math.floor(1000000*latd)/1000000; ;lngd=lngd1; ;document.getElementById("DDLonBox0").value = Math.floor(1000000*lngd)/1000000; ;} ;if(isNaN(lngd)){lngd = latd1;} If (Not (IsNumber($latd)) )Or (Not (IsNumber($lngd)) ) Then ;if(isNaN(latd)|| isNaN(lngd)){ ;alert("Non-Numeric Input Value"); ConsoleWrite("Non-Numeric Input Value" & @CRLF) EndIf ;} ;if(latd <-90 || latd> 90){ If ($latd <-90 Or $latd> 90) then ;alert("Latitude must be between -90 and 90"); ConsoleWrite("Latitude must be between -90 and 90" & @CRLF) EndIf ;if(lngd <-180 || lngd > 180){ If ($lngd <-180 Or $lngd > 180) then ;alert("Latitude must be between -180 and 180"); ConsoleWrite("Longitud must be between -180 and 180") ;} EndIf $xd = $lngd; $yd = $latd; ;?????????????????????????? ES NECESARIO ????????????????????????? ;DDtoDMS(); ;//Read Input from DMS Boxes ;document.getElementById("DLatBox0").value = Math.floor(ydd); ;document.getElementById("MLatBox0").value = ym; ;document.getElementById("SLatBox0").value = Math.floor(1000*ys)/1000; ;document.getElementById("DLonBox0").value = Math.floor(xdd); ;document.getElementById("MLonBox0").value = xm; ;document.getElementById("SLonBox0").value = Math.floor(1000*xs)/1000; ;?????????????????????????????????????????????????????????????????? $phi = $latd*$drad;//Convert latitude to radians $lng = $lngd*$drad;//Convert longitude to radians $utmz = 1 + floor(($lngd+180)/6);//calculate utm zone $latz = 0;//Latitude zone: A-B S of -80, C-W -80 to +72, X 72-84, Y,Z N of 84 ;if (latd > -80 && latd < 72){latz = Math.floor((latd + 80)/8)+2;} If ($latd > -80 And $latd < 72) Then $latz = floor(($latd + 80)/8)+2 EndIf ;if (latd > 72 && latd < 84){latz = 21;} If ($latd > 72 AND $latd < 84) Then $latz = 21 EndIf ;if (latd > 84){latz = 23;} If $latd > 84 Then $latz = 23 EndIf $zcm = 3 + 6*($utmz-1) - 180;//Central meridian of zone ;//alert(utmz + " " + zcm); ;//Calculate Intermediate Terms $e0 = $e/sqrt(1 - $e*$e);//Called e prime in reference $esq = (1 - ($b/$a)*($b/$a));//e squared for use in expansions $e0sq = $e*$e/(1-$e*$e);// e0 squared - always even powers ;//alert(esq+" "+e0sq) ;N = a/Math.sqrt(1-Math.pow(e*Math.sin(phi),2)); $N = $a/sqrt(1-(($e*sin($phi))^2)); ;//alert(1-Math.pow(e*Math.sin(phi),2)); ;//alert("N= "+N); $T = (tan($phi)^2); ;//alert("T= "+T); ;C = e0sq*Math.pow(Math.cos(phi),2); $C = $e0sq*(cos($phi)^2); ;//alert("C= "+C); $A1 = ($lngd-$zcm)*$drad*cos($phi); ;//alert("A= "+A); ;//Calculate M ;M = phi*(1 - esq*(1/4 + esq*(3/64 + 5*esq/256))); ;M = M - Math.sin(2*phi)*(esq*(3/8 + esq*(3/32 + 45*esq/1024))); ;M = M + Math.sin(4*phi)*(esq*esq*(15/256 + esq*45/1024)); ;M = M - Math.sin(6*phi)*(esq*esq*esq*(35/3072)); $M = $phi*(1 - $esq*(1/4 + $esq*(3/64 + 5*$esq/256))); ;Consolewrite("M1 " & $M & @CRLF) $M = $M -sin(2*$phi)*($esq*(3/8 + $esq*(3/32 + 45*$esq/1024))); ;Consolewrite("M2 " & $M & @CRLF) $M = $M + sin(4*$phi)*($esq*$esq*(15/256 + $esq*45/1024)); ;Consolewrite("M3 " & $M & @CRLF) $M = $M - sin(6*$phi)*($esq*$esq*$esq*(35/3072)); ;Consolewrite("M4 " & $M & @CRLF) $M = $M*$a;//Arc length along standard meridian ;//alert(a*(1 - esq*(1/4 + esq*(3/64 + 5*esq/256)))); ;//alert(a*(esq*(3/8 + esq*(3/32 + 45*esq/1024)))); ;//alert(a*(esq*esq*(15/256 + esq*45/1024))); ;//alert(a*esq*esq*esq*(35/3072)); ;//alert(M); ;Consolewrite("M " & $M & @CRLF) ;Consolewrite("$a " & $a & @CRLF) ;Consolewrite("$A1 " & $A1 & @CRLF) ;Consolewrite("$esq " & $esq & @CRLF) ;Consolewrite("$phi" & $phi & @CRLF) $M0 = 0;//M0 is M for some origin latitude other than zero. Not needed for standard UTM ;//alert("M ="+M); ;//Calculate UTM Values $x = $k0*$N*$A1*(1 + $A1*$A1*((1-$T+$C)/6 + $A1*$A1*(5 - 18*$T + $T*$T + 72*$C -58*$e0sq)/120));//Easting relative to CM $x=$x+500000;//Easting standard ;y = k0*(M - M0 + N*Math.tan(phi)*(A*A*(1/2 + A*A*((5 - T + 9*C + 4*C*C)/24 + A*A*(61 - 58*T + T*T + 600*C - 330*e0sq)/720))));//Northing from equator $y = $k0*($M - $M0 + $N*tan($phi)*($A1*$A1*(1/2 + $A1*$A1*((5 - $T + 9*$C + 4*$C*$C)/24 + $A1*$A1*(61 - 58*$T + $T*$T + 600*$C - 330*$e0sq)/720))));//Northing from equator $yg = $y + 10000000;//yg = y global, from S. Pole ;if (y < 0){y = 10000000+y;} If $y <0 Then $y= 10000000+$y EndIf ;//Output into UTM Boxes ;document.getElementById("UTMzBox1").value = utmz; Esto es la zona ;document.getElementById("UTMeBox1").value = Math.round(10*(x))/10; Esto es X ;document.getElementById("UTMnBox1").value = Math.round(10*y)/10; Esto es Y ;if (phi<0){document.getElementById("SHemBox").checked=true;} ESto es si es norte o SUR $x =round(10*$x)/10 $y =round(10*$y)/10 $utmz = $utmz If $phi<0 then $SUR=True Else $SUR=False EndIf ;//document.getElementById("UTMzBox1").value = utmz; ;//document.getElementById("UTMeBox1").value = Math.round(10*(500000+x))/10; ;document.getElementById("UTMLonZoneBox2").value = utmz; ;document.getElementById("UTMLatZoneBox2").value = DigraphLetrsE[latz]; ;document.getElementById("UTMeBox2").value = Math.round(10*(x-100000*Math.floor(x/100000)))/10; ;document.getElementById("UTMnBox2").value = Math.round(10*(y-100000*Math.floor(y/100000)))/10; ;//Generate Digraph ;MakeDigraph(); ;document.getElementById("UTMDgBox2").value = Digraph; Endfunc;//close Geog to UTM Func UTMtoGeog($x,$y, Byref $longitud, Byref $latitud, $utmz=30, $SUR=FALSE, $DATUM=0) ;$SUR hemisphere ($SUR=False is North, $SUR=true is South) ;$utmz = UTM Zone ($utmz) ; $DATUM ;~ //Datum Info here: Name, a, b, f, 1/f ;~ 0 //WGS 84 6,378,137.0 6356752.314 0.003352811 298.2572236 ;~ 1 //NAD 83 6,378,137.0 6356752.314 0.003352811 298.2572236 ;~ 2 //GRS 80 6,378,137.0 6,356,752.3 0.003352811 298.2572215 ;~ 3 //WGS 72 6,378,135.0 6,356,750.5 0.003352783 298.2597208 ;~ 4 //Australian 1965 6,378,160.0 6,356,774.7 0.003352895 298.2497323 ;~ 5 //Krasovsky 1940 6,378,245.0 6,356,863.0 0.003352333 298.2997381 ;~ 6 //North American 1927 6,378,206.4 6,356,583.8 0.003390075 294.9786982 ;~ 7 //International 1924 6,378,388.0 6,356,911.9 0.003367011 296.9993621 ;~ 8 //Hayford 1909 6,378,388.0 6,356,911.9 0.003367011 296.9993621 ;~ 9 //Clarke 1880 6,378,249.1 6,356,514.9 0.00340755 293.4660167 ;~ 10 //Clarke 1866 6,378,206.4 6,356,583.8 0.003390075 294.9786982 ;~ 11 //Airy 1830 6,377,563.4 6,356,256.9 0.003340853 299.3247788 ;~ 12 //Bessel 1841 6,377,397.2 6,356,079.0 0.003342774 299.1527052 ;~ 13 //Everest 1830 6,377,276.3 6,356,075.4 0.003324444 300.8021499 ;//Convert UTM Coordinates to Geographic ; More information in: ; https://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM ; IMPORT from javascript version of: https://www.uwgb.edu/dutchs/UsefulData/ConvertUTMNoOZ.HTM ;Declarations(); ;Symbols as used in USGS PP 1395: Map Projections - A Working Manual Local $M_PI= 3.14159265358979323846 Local $DatumEqRad [14] = [6378137.0,6378137.0,6378137.0,6378135.0,6378160.0,6378245.0,6378206.4, 6378388.0,6378388.0,6378249.1,6378206.4,6377563.4,6377397.2,6377276.3]; Local $DatumFlat[14] = [298.2572236, 298.2572236, 298.2572215, 298.2597208, 298.2497323, 298.2997381, 294.9786982, 296.9993621, 296.9993621, 293.4660167, 294.9786982, 299.3247788, 299.1527052, 300.8021499]; Local $Item = $DATUM Local $k0 = 0.9996;//scale on central meridian Local $a = $DatumEqRad[$Item];//equatorial radius, meters. Local $f = 1/$DatumFlat[$Item];//polar flattening. Local $b = $a*(1-$f);//polar axis. Local $e = Sqrt (1 - ($b*$b)/($a*$a));//eccentricity Local $drad = $M_PI/180;//Convert degrees to radians) Local $latd = 0;//latitude in degrees Local $phi = 0;//latitude (north +, south -), but uses phi in reference Local $e0 = $e/Sqrt(1 - $e*$e);//e prime in reference ;; Creo que no hace falta y da error $N = $a/Sqrt(1-Math.pow($e*sin($phi)),2); Local $T = (Tan($phi)^2); Local $C = ($e*(cos($phi)^2)); Local $lng = 0;//Longitude (e = +, w = -) - can't use long - reserved word Local $lng0 = 0;//longitude of central meridian Local $lngd = 0;//longitude in degrees Local $M = 0;//M requires calculation ;$x = 0;//x coordinate ;$y = 0;//y coordinate Local $k = 1;//local scale ;$utmz = 30;//utm zone Local $zcm = 0;//zone central meridian Local $DigraphLetrsE = "ABCDEFGHJKLMNPQRSTUVWXYZ"; Local $DigraphLetrsN = "ABCDEFGHJKLMNPQRSTUV"; ;document.getElementById("EqRadBox").value = a; ;document.getElementById("PolRadBox").value = b; ;document.getElementById("FlatBox").value = f; ;document.getElementById("RecipBox").value = 1/f; ;Consolewrite ("EqRadBox " & $a & @CRLF) ;Consolewrite ("PolRadBox " & $b & @CRLF) ;Consolewrite ("FlatBox " & $f & @CRLF) ;Consolewrite ("RecipBox " & (1/$f) & @CRLF) Local $OOZok = false; ;Fin de Declarations ;; $k0 = 0.9996;//scale on central meridian ;; $b = $a*(1-$f);//polar axis. ;; $e = Sqrt(1 - ($b/$a)*($b/$a));//eccentricity ;; $e0 = $e/Sqrt(1 - $e*$e);//Called e prime in reference Local $esq = (1 - ($b/$a)*($b/$a));//e squared for use in expansions Local $e0sq = $e*$e/(1-$e*$e);// e0 squared - always even powers ;x = parseFloat(document.getElementById("UTMeBox1").value); ;ConsoleWrite("$x " & $x & @CRLF) if ($x<160000 OR $x>840000) Then ConsoleWrite("Outside permissible range of easting values" & @CRLF & "Results may be unreliable" & @CRLF & "Use with caution" & @CRLF);} EndIf ;y = parseFloat(document.getElementById("UTMnBox1").value); ;//alert(y) if ($y<0)Then ConsoleWrite("Negative values not allowed" & @CRLF & "Results may be unreliable" & @CRLF & "Use with caution" & @CRLF) EndIf ;} if ($y>10000000)then ConsoleWrite("Northing may not exceed 10,000,000" & @CRLF & "Results may be unreliable" & @CRLF & "Use with caution"& @CRLF);} EndIf ;utmz = parseFloat(document.getElementById("UTMzBox1").value); $zcm = 3 + 6*($utmz-1) - 180;//Central meridian of zone Local $e1 = (1 - Sqrt(1 - $e*$e))/(1 + Sqrt(1 - $e*$e));//Called e1 in USGS PP 1395 also Local $M0 = 0;//In case origin other than zero lat - not needed for standard UTM $M = $M0 + $y/$k0;//Arc length along standard meridian. if $SUR=true then $M=$M0+($y-10000000)/$k;} EndIf Local $mu = $M/($a*(1 - $esq*(1/4 + $esq*(3/64 + 5*$esq/256)))); Local $phi1 = $mu + $e1*(3/2 - 27*$e1*$e1/32)*sin(2*$mu) + $e1*$e1*(21/16 -55*$e1*$e1/32)*sin(4*$mu);//Footprint Latitude $phi1 = $phi1 + $e1*$e1*$e1*(sin(6*$mu)*151/96 + ($e1*sin(8*$mu)*1097)/512); Local $C1 = $e0sq*(cos($phi1)^2); Local $T1 = tan($phi1)^2; Local $N1 = $a/sqrt(1-((($e*sin($phi1))^2))); Local $R1 = ($N1*(1-$e*$e))/(1-((($e*sin($phi1))^2)));R1 = N1*(1-e*e)/(1-Math.pow(e*Math.sin(phi1),2)); Local $D = ($x-500000)/($N1*$k0); $phi = ($D*$D)*(1/2 - $D*$D*(5 + 3*$T1 + 10*$C1 - 4*$C1*$C1 - 9*$e0sq)/24); $phi = $phi + (($D^6)*(61 + 90*$T1 + 298*$C1 + 45*$T1*$T1 -252*$e0sq - 3*$C1*$C1))/720; $phi = $phi1 - (($N1*tan($phi1))/$R1)*$phi; ;//Output Latitude ;document.getElementById("DDLatBox0").value = Math.floor(1000000*phi/drad)/1000000; $latitud= floor(1000000*$phi/$drad)/1000000; Consolewrite( "latitud: " & $latitud & @CRLF) ;//Longitude $lng = $D*(1 + $D*$D*((-1 -2*$T1 -$C1)/6 + $D*$D*(5 - 2*$C1 + 28*$T1 - 3*$C1*$C1 +8*$e0sq + 24*$T1*$T1)/120))/cos($phi1); $lngd = $zcm+$lng/$drad; ;//Output Longitude ;document.getElementById("DDLonBox0").value = Math.floor(1000000*lngd)/1000000; $longitud=floor(1000000*$lngd)/1000000; Consolewrite( "Longitud: " & $longitud & @CRLF) ;//Parse DMS ;~ xd = lngd; ;~ yd = phi/drad; ;~ DDtoDMS(); Para pasar a Grados minutos y segundos. ;~ document.getElementById("DLatBox0").value = Math.floor(ydd); ;~ document.getElementById("MLatBox0").value = ym; ;~ document.getElementById("SLatBox0").value = Math.floor(1000*ys)/1000; ;~ document.getElementById("DLonBox0").value = Math.floor(xdd); ;~ document.getElementById("MLonBox0").value = xm; ;~ document.getElementById("SLonBox0").value = Math.floor(1000*xs)/1000; ;~ document.getElementById("UTMLonZoneBox2").value = utmz; ;~ document.getElementById("UTMLatZoneBox2").value = DigraphLetrsE[latz]; ;~ document.getElementById("UTMeBox2").value = Math.round(10*(x-100000*Math.floor(x/100000)))/10; ;~ document.getElementById("UTMnBox2").value = Math.round(10*(y-100000*Math.floor(y/100000)))/10; ;~ MakeDigraph(); ;~ document.getElementById("UTMDgBox2").value = Digraph; EndFunc; End UTM to Geog  
    • rynow
      By rynow
      romaSQL
      This autoIt UDF is built on the concept of Laravel Query & doctrine.
      RomaSQL provides a new, comfortable and easy to use way for SQL-queries in autoIt.
      Most of the common SQL-queries are supported already and more are coming soon.
      All of your support is much appreciated.
      Connections
      For the connection the object ADODB is used. Therefore the connection string is based on ODBC.
      You can also use OLEDB connection strings or other database connections.
      In order for this to work your add-ons have to be installed in the function: __4ern_SQL_Connection.
      I’d be very glad if you shared your modifications with me.
      Currently supported connections
      -       MySQL (odbc)
      -       Microsoft SQL Server (odbc)
      -       SQLite (odbc)
      -       Microsoft Access (odbc)
      Command reference
      $SQL_connect; establishing connection $SQL_returnType; return a Array or Dictionary ('oDict') Object (Default = Array) $SQL_setDefaultTable; Default Tablename $SQL_setDefaultKey; Default Colmn Key (Default = id) $SQL_debug; if True, show SQL Statment in Console $SQL_get $SQL_update $SQL_delete $SQL_insertInto $SQL_take $SQL_limit $SQL_table $SQL_select $SQL_distinct $SQL_where $SQL_orWhere $SQL_whereBetween $SQL_whereNotBetween $SQL_whereIn $SQL_whereNotIn $SQL_whereNull $SQL_whereNotNull $SQL_having $SQL_orHaving $SQL_havingBetween $SQL_havingNotBetween $SQL_havingIn $SQL_havingNotIn $SQL_havingNull $SQL_havingNotNull $SQL_groupBy $SQL_orderBy  
      Examples
      establishing connection
      ;-----/ ; SQLite Connection ;-----/ $SQL_setDatabase('sqlite') $SQL_connect('C:\project.db') ;-----/ ; Access Connection ; Database, User, Password ;-----/ $SQL_setDatabase('access') $SQL_connect('C:\project.mdb') ;or as Admin $SQL_connect('C:\project.mdb', '4ern', 'root') ;-----/ ; SQLServer Connection ; Database, User, Password, Server, Driver ;-----/ $SQL_setDatabase('sqlserver') $SQL_connect('myDB', '4ern', 'root', 'localhost') ;or with Driver $SQL_connect('myDB', '4ern', 'root', 'localhost', 'SQL Server') ;-----/ ; MySQL Connection ; Database, User, Password, Server, Driver ;-----/ $SQL_setDatabase('mysql') $SQL_connect('myDB', '4ern', 'root', 'localhost') ;or with Driver $SQL_connect('myDB', '4ern', 'root', 'localhost', 'MySQL ODBC 5.2 UNICODE Driver')  
      simple SQL query
      $SQL_table('albums') $aRet = $SQL_get() if IsArray($aRet ) then _ArrayDisplay($aRet ) else ConsoleWrite('Keine Ergebnisse' & @LF) endif  
      Select
      $SQL_table('albums') $SQL_select('id', 'Name', 'Artist', 'Song') ;or pass to an Array Local $aSelect = ['id', 'Name', 'Artist', 'Song'] $SQL_select($aSelect) $aRet = $SQL_get() if IsArray($aRet ) then _ArrayDisplay($aRet ) else ConsoleWrite('Keine Ergebnisse' & @LF) endif where
      $SQL_table('albums') $SQL_select('id', 'Name', 'Artist', 'Song', 'Votes') $SQL_where('Artist', 'adele') $SQL_where('Votes', '>=' ,'9') $SQL_orWhere('Artist', '=' ,'Rag'n'Bone Man') ;or pass to an 2dArray Local $aSelect = [['Artist','adele'],['Votes', '>=' ,'9']] $SQL_where($aSelect) $aRet = $SQL_get() if IsArray($aRet ) then _ArrayDisplay($aRet ) else ConsoleWrite('Keine Ergebnisse' & @LF) endif  
      If you need more examples, then tell me exactly what you need.
      I hope you like my UDF and find some use for it.
      ---
      ->DONWLOAD romaSQL
       
       
    • macran
      By macran
      I use mysql.au3 to connect mysql database .  If restart the server ,the client how to reconnect mysql?
      The function prototype is
      _MySQL_Options($MySQL_ptr, $option, $arg = 0, $type = "ptr")
      so,
      _MySQL_Options($MysqlConn,$MYSQL_OPT_RECONNECT, ?, ?)
      pls help me,thanks!
       
       
       
    • sivaramanm
      By sivaramanm
      From AutoIT script (Pretty much same syntax as VBA), Tried connecting to MySQL Server. While i am able to insert a new row successfully, unable to verify the rowcount (# of inserted row - to verify success or failure).
      Have tried two different methods -
      to use the RecordsAffected variable from Connection Execute function to use the RecordSet and retrieve the rowcount But have been missing something and none of these methods return the actual row count.
      Any help would be appreciated.!!!
      Cross-posted in http://stackoverflow.com/questions/27411599/unable-to-retrieve-inserted-row-count-in-mysql-using-ado-from-autoit
      MySQLConnect() $EVENT_TIME= "2014-12-12 12:12:12" $LSMCName='LSMC1' $NEType='MME0001' $OMTarFile='A_MME0011-60MIN-20141212-12-v.tar' $CSVFile='12-00-S1AP.csv' $KPIType='S1AP_HO' $UpdateStatus='NotUpdated' $ReTries='0' If Not (InsertFileUpdateLog($EVENT_TIME,$LSMCName,$NEType,$OMTarFile,$CSVFile,$KPIType,$UpdateStatus,$ReTries)=1) Then WriteLog("[Error] Record insertion failed for " & $EVENT_TIME & '" ' & $LSMCName & ' ' & $NEType & ' ' & $OMTarFile & ' ' & $CSVFile & ' ' & $KPIType & ' ' & ' NotUpdated 0') EndIf MysqlDisconnect() ;~ ####################### Sub Function Definitions Func MySQLConnect() Local $sDriver="MySQL ODBC 5.3 ANSI Driver" Local $key = "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers", $val = RegRead($key, $sDriver) If @error or $val = "" Then SetError(2) Return -1 EndIf $constrim="DRIVER={MySQL ODBC 5.3 ANSI Driver};SERVER=localhost;DATABASE=pmdemo;uid=rootuser;pwd=rootpass;" $oDBConnect = ObjCreate ("ADODB.Connection") ; <== Create SQL connection $oDBConnect.Open ($constrim) ; <== Connect with required credentials if @error Then WriteLog("[Error] Failed to connect to the database") SetError(2) Return -2 Else ;MsgBox(0, "Success!", "Connection to database successful!") Return 1 EndIf EndFunc Func MySQLDisConnect() $oDBConnect.Close ; ==> Close the database EndFunc Func InsertFileUpdateLog($EVENT_TIME,$LSMCName,$NEType,$OMTarFile,$CSVFile,$KPIType,$UpdateStatus,$ReTries) Local $RowCount = 0 Local $result = ObjCreate("ADODB.Recordset") $sQuery = "INSERT INTO 4gc_fileupdatelog (id,EVENT_TIME,LSMC,NEType,TarFile,CSVFile,KPIFile,UpdateStatus,ReTries) VALUES ('0'," & _ "'" & $EVENT_TIME & "'," & _ "'" & $LSMCName & "'," & _ "'" & $NEType & "'," & _ "'" & $OMTarFile & "'," & _ "'" & $CSVFile & "'," & _ "'" & $KPIType & "'," & _ "'" & $UpdateStatus & "'," & _ "'" & $ReTries & "'" & _ ") ON DUPLICATE KEY UPDATE ReTries=ReTries+1,UpdateStatus='" & $UpdateStatus & "';" $result = $oDBConnect.Execute($sQuery,$RowCount) If @error Then MsgBox(1,1,"Error executing query...") Return -2 EndIf ;# Method-1 : To use records affected from Execute function If $RowCount >= 1 Then MsgBox(1,1,"Success") Else MsgBox(1,1,"Failed, rowcount is:" & $RowCount ) EndIf If Not ($result.bof AND $result.eof) Then WriteLog("[Error] No Rows found") Return 0 EndIf ;# Method-2 : To use recordsset object and retrieve the rows/columns count If IsObj($result) And $result.EOF=False Then $myarray=$result.GetRows() $rows = UBound($myarray,1) $cols = UBound($myarray,2) MsgBox(1,1," rows: " & $rows & " cols: " & $cols) If ($rows = 1) Then WriteLog("[Info] Record inserted successfully") Return 1 ElseIf ($rows = 2) Then WriteLog("[Alert] Record updated successfully. affected row(s) is " & $rows) Return $rows Else > Blockquote WriteLog("[Error] Record insertion failed. affected row(s) is " & $rows) Return 0 EndIf EndIf EndFunc