Esempio n. 1
0
File: data.go Progetto: enderlu/vfp
//Terminates a connection to a data source.
func SqlDisConnect(conn *odbc.Connection) {

	zr, ok := GStatementPerConnection[conn]
	if ok {
		for _, zstmt := range zr {
			zstmt.Close()
		}
	} else {
		panic("Connection is invalid")
	}

	conn.Close()
}
Esempio n. 2
0
File: data.go Progetto: enderlu/vfp
//Prepares a SQL statement for remote execution by SQLEXEC( ).
func SqlPrepare(zconn *odbc.Connection, zselect string, zcursor string) (*odbc.Statement, *odbc.ODBCError) {
	zstmt, zerr := zconn.Prepare(zselect)
	GPrepareMapCursor[zstmt] = zcursor
	GStatementPerConnection[zconn] = append(GStatementPerConnection[zconn], zstmt)
	return zstmt, zerr
}