INSERT INTO添加前导和尾随空格

时间:2018-07-18 08:58:32

标签: access-vba

为什么INSERT INTO在下面的字符串中添加前导和尾随空格:

    CurrentDb.Execute "INSERT INTO [Rounds] ([Round ID],[Cource ID],[Round Date],[Tee Time],[Handicap Round],[Player ID],[Player HCP],[Slope],[Tee],[Holes Played],[Comments],[Green Fee],[GF Term])" & _
                                    " VALUES (' " & TempVars!tvNewRoundID & " ',' " & TempVars!tvCourceID & " ',' " & TempVars!tvRoundDate & " ',' " & TempVars!tvTeeTime & " ',' " & TempVars!tvHandicapRound & " ',' " & TempVars!tvPlayerID & " ',' " & [Forms]![Data Entry Form]![txtPlayerHCP] & " ',' " & TempVars!tvPlayerSlope & " ',' " & TempVars!tvTeeName & " ',' " & TempVars!tvHolesPlayed & " ',' " & TempVars!tvComments & " ',' " & TempVars!tvGreenFee & " ',' " & TempVars!tvGreenFeeTerm & " ' );" 

声明如下: 将tvNewRoundID公开为TempVars 将公共tvRoundDate用作TempVars 公开tvTeeName作为变体等

该问题仅适用于字符串,其他所有都可以正常工作。我尝试在INSERT INTO之前进行修剪但无济于事,在表中显示空格。

0 个答案:

没有答案